cmake check_c_source_runs examples

Signatures

check_c_source_runs(<code> <resultVar>)

Examples

AtomicGameEngine/AtomicGameEngine Source/ThirdParty/libcurl/CMake/OtherTests.cmake :186

check_c_source_runs("
  #ifdef HAVE_SYS_POLL_H
  #  include <sys/poll.h>
  #endif
  int main(void) {
    return poll((void *)0, 0, 10 /*ms*/);
  }" HAVE_POLL_FINE)

urho3d/urho3d Source/ThirdParty/SDL/cmake/sdlchecks.cmake :814

check_c_source_runs("
        #include <pthread.h>
        int main(int argc, char** argv) {
          pthread_attr_t type;
          pthread_attr_init(&type);
          return 0;
        }" HAVE_PTHREADS)

RavEngine/RavEngine deps/resonance-audio/third_party/eigen/cmake/FindPTSCOTCH.cmake :401

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

cnr-isti-vclab/meshlab unsupported/plugins_unsupported/external/CoMISo/cmake/FindPackageMultipass.cmake :89

check_c_source_runs ("${source}" ${testname})

liminchen/OptCuts ext/libigl/external/eigen/cmake/FindPTSCOTCH.cmake :402

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

ByConity/ByConity contrib/aws-cmake/AwsFeatureTests.cmake :20

check_c_source_runs("
    #include <stdbool.h>
    bool foo(int a, int b, int *c) {
        return __builtin_mul_overflow(a, b, c);
    }
    int main() {
        int out;
        if (foo(1, 2, &out)) {
            return 0;
        }
        return 0;
    }" AWS_HAVE_GCC_OVERFLOW_MATH_EXTENSIONS)

lizardfs/lizardfs cmake/FindJudy.cmake :42

check_c_source_runs("${_CHECK_FOR_JUDY1_BUG}" JUDY_HAVE_WORKING_JUDY1)

mne-tools/mne-cpp src/external/eigen-3.4.0/cmake/FindPTSCOTCH.cmake :401

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

TigerVNC/tigervnc CMakeLists.txt :247

check_c_source_runs("${JPEG_TEST_SOURCE}" FOUND_LIBJPEG_TURBO)

adventuregamestudio/ags libsrc/allegro/CMakeLists.txt :97

check_c_source_runs("
        static int notsupported = 1;
        void test_ctor (void) __attribute__((constructor));
        void test_ctor (void) { notsupported = 0; }
        int main(void) { return (notsupported); }
        "
            ALLEGRO_USE_CONSTRUCTOR)

google/filament third_party/libsdl2/cmake/sdlchecks.cmake :910

check_c_source_runs("
        #include <pthread.h>
        int main(int argc, char** argv) {
          pthread_attr_t type;
          pthread_attr_init(&type);
          return 0;
        }" HAVE_PTHREADS)

elemental/Elemental cmake/modules/FindMETIS.cmake :99

check_c_source_runs("
#define METIS_EXPORT
#include \"metis.h\"
int main( int argc, char* argv[] )
{
  // FIXME: Find a simple but sensible test for METIS
  return 0;
}
" METIS_TEST_RUNS)

percona/percona-xtrabackup configure.cmake :319

CHECK_C_SOURCE_RUNS("
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sched.h>
int main()
{
  (void)setns(0, 0);
  return 0;
}" HAVE_SETNS)

NREL/EnergyPlus third_party/eigen/cmake/FindPTSCOTCH.cmake :402

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

resiprocate/resiprocate CMakeLists.txt :872

check_c_source_runs("
   #include <time.h>
   int main() {
      struct timespec ts;
      clock_gettime(CLOCK_MONOTONIC, &ts);
      return 0;
   }" HAVE_CLOCK_GETTIME_MONOTONIC)

appleseedhq/appleseed cmake/modules/DELETE.FindLZ4.cmake :17

check_c_source_runs("
#include <lz4.h>
int main() {
  int good = (LZ4_VERSION_MAJOR > 1) ||
    ((LZ4_VERSION_MAJOR == 1) && (LZ4_VERSION_MINOR >= 7));
return !good;
}" LZ4_GOOD_VERSION)

mysql/mysql-server configure.cmake :318

CHECK_C_SOURCE_RUNS("
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sched.h>
int main()
{
  (void)setns(0, 0);
  return 0;
}" HAVE_SETNS)

OSVR/OSVR-Core vendor/eigen/cmake/FindPTSCOTCH.cmake :402

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

infiniflow/infinity third_party/curl/CMakeLists.txt :1615

check_c_source_runs("
    int main(int argc, char **argv)
    {
      (void)argc;
      argv[0][0] = ' ';
      return (argv[0][0] == ' ')?0:1;
    }" HAVE_WRITABLE_ARGV)

AshamaneProject/AshamaneCore dep/cpr/opt/curl/CMake/OtherTests.cmake :188

check_c_source_runs("
    #ifdef HAVE_SYS_POLL_H
    #  include <sys/poll.h>
    #endif
    int main(void) {
      return poll((void *)0, 0, 10 /*ms*/);
    }" HAVE_POLL_FINE)

FilmKilns/FilmKilns src/sdl2/cmake/sdlchecks.cmake :890

check_c_source_runs("
        #include <pthread.h>
        int main(int argc, char** argv) {
          pthread_attr_t type;
          pthread_attr_init(&type);
          return 0;
        }" HAVE_PTHREADS)

asset-group/5ghoul-5g-nr-attacks libs/libzmq/builds/cmake/Modules/ZMQSourceRunChecks.cmake :5

check_c_source_runs(
    "
#include <sys/types.h>
#include <sys/socket.h>

int main(int argc, char *argv [])
{
    int s = socket(PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
    return(s == -1);
}
"
    ZMQ_HAVE_SOCK_CLOEXEC)

alibaba/AliSQL configure.cmake :1000

CHECK_C_SOURCE_RUNS("
  int main()
  { 
    __asm__ __volatile__ (\"pause\"); 
    return 0;
  }"  HAVE_PAUSE_INSTRUCTION)

arximboldi/immer cmake/FindBoehmGC.cmake :67

check_c_source_runs(
    "#include <gc.h>
int main() {
int i= GC_get_parallel();
return 0;
}
"
    GC_GET_PARALLEL_WORKS)

InsightSoftwareConsortium/ITK Modules/ThirdParty/JPEG/src/itkjpeg-turbo/CMakeLists.txt :47

check_c_source_runs("
      #include <stdio.h>
      #include <stdlib.h>
      static int is_shifting_signed (long arg) {
        long res = arg >> 4;
        if (res == -0x7F7E80CL)
          return 1; /* right shift is signed */
        /* see if unsigned-shift hack will fix it. */
        /* we can't just test exact value since it depends on width of long... */
        res |= 0xFFFFFFFFL << (32-4);
        if (res == -0x7F7E80CL)
          return 0; /* right shift is unsigned */
        printf(\"Right shift isn't acting as I expect it to.\\\\n\");
        printf(\"I fear the JPEG software will not work at all.\\\\n\\\\n\");
        return 0; /* try it with unsigned anyway */
      }
      int main (void) {
        exit(is_shifting_signed(-0x7F7E80B1L));
      }" RIGHT_SHIFT_IS_UNSIGNED)

logicalclocks/rondb configure.cmake :320

CHECK_C_SOURCE_RUNS("
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sched.h>
int main()
{
  (void)setns(0, 0);
  return 0;
}" HAVE_SETNS)

Warzone2100/warzone2100 cmake/AddTargetLinkFlagsIfSupported.cmake :130

CHECK_C_SOURCE_RUNS("${_test_source}" ${_RESULT})

crossuo/crossuo deps/cmcurl/CMake/OtherTests.cmake :229

check_c_source_runs("
    #include <stdlib.h>
    #include <sys/time.h>

    #ifdef HAVE_SYS_POLL_H
    #  include <sys/poll.h>
    #elif  HAVE_POLL_H
    #  include <poll.h>
    #endif

    int main(void)
    {
        if(0 != poll(0, 0, 10)) {
          return 1; /* fail */
        }
        else {
          /* detect the 10.12 poll() breakage */
          struct timeval before, after;
          int rc;
          size_t us;

          gettimeofday(&before, NULL);
          rc = poll(NULL, 0, 500);
          gettimeofday(&after, NULL);

          us = (after.tv_sec - before.tv_sec) * 1000000 +
            (after.tv_usec - before.tv_usec);

          if(us < 400000) {
            return 1;
          }
        }
        return 0;
    }" HAVE_POLL_FINE)

pingcap/tiflash contrib/aws-cmake/AwsFeatureTests.cmake :20

check_c_source_runs("
    #include <stdbool.h>
    bool foo(int a, int b, int *c) {
        return __builtin_mul_overflow(a, b, c);
    }

    int main() {
        int out;
        if (foo(1, 2, &out)) {
            return 0;
        }

        return 0;
    }" AWS_HAVE_GCC_OVERFLOW_MATH_EXTENSIONS)

ornladios/ADIOS2 cmake/DetectOptions.cmake :145

check_c_source_runs("
    #include <zfp.h>

    int main()
    {
      zfp_stream* stream = zfp_stream_open(NULL);
      return !zfp_stream_set_execution(stream, zfp_exec_cuda);
    }"
    ADIOS2_HAVE_ZFP_CUDA)

boutproject/BOUT-dev cmake/FindPackageMultipass.cmake :99

check_c_source_runs ("${source}" ${testname})

neka-nat/cupoch third_party/libjpeg-turbo/libjpeg-turbo/CMakeLists.txt :397

check_c_source_runs("
      #include <stdio.h>
      #include <stdlib.h>
      int is_shifting_signed (long arg) {
        long res = arg >> 4;
        if (res == -0x7F7E80CL)
          return 1; /* right shift is signed */
        /* see if unsigned-shift hack will fix it. */
        /* we can't just test exact value since it depends on width of long... */
        res |= (~0L) << (32-4);
        if (res == -0x7F7E80CL)
          return 0; /* right shift is unsigned */
        printf(\"Right shift isn't acting as I expect it to.\\\\n\");
        printf(\"I fear the JPEG software will not work at all.\\\\n\\\\n\");
        return 0; /* try it with unsigned anyway */
      }
      int main (void) {
        exit(is_shifting_signed(-0x7F7E80B1L));
      }" RIGHT_SHIFT_IS_UNSIGNED)

ewan-xu/LibrosaCpp librosa/eigen3/cmake/FindPTSCOTCH.cmake :402

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

zeromq/libzmq builds/cmake/Modules/ZMQSourceRunChecks.cmake :5

check_c_source_runs(
    "
#include <sys/types.h>
#include <sys/socket.h>

int main(int argc, char *argv [])
{
    int s = socket(PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
    return(s == -1);
}
"
    ZMQ_HAVE_SOCK_CLOEXEC)

DocCreator/DocCreator software/DocCreator/src/Degradations/Distortion3DModel/thirdparty/eigen-3.3.7/cmake/FindPTSCOTCH.cmake :402

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

facebook/mysql-5.6 configure.cmake :318

CHECK_C_SOURCE_RUNS("
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sched.h>
int main()
{
  (void)setns(0, 0);
  return 0;
}" HAVE_SETNS)

polardb/polardbx-engine configure.cmake :314

CHECK_C_SOURCE_RUNS("
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sched.h>
int main()
{
  (void)setns(0, 0);
  return 0;
}" HAVE_SETNS)

axmolengine/axmol cmake/Modules/AXConfigSIMD.cmake :38

check_c_source_runs("${source}" ${outputVar})

weigao95/surfelwarp external/eigen3.4/cmake/FindPTSCOTCH.cmake :402

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

powerserve-project/PowerServe libs/ggml/cmake/FindSIMD.cmake :61

check_c_source_runs("${${type}_CODE}" HAS_${type}_${__FLAG_I})

feelpp/feelpp feelpp/cmake/modules/FindPackageMultipass.cmake :89

check_c_source_runs ("${source}" ${testname})

klee/klee CMakeLists.txt :452

check_c_source_runs("int main(int argc, char** argv){return 0;}" CHECK_M32_SUPPORT)

UPBGE/upbge build_files/cmake/macros.cmake :571

check_c_source_runs("
      #include <nmmintrin.h>
      #include <emmintrin.h>
      #include <smmintrin.h>
      int main(void) {
        __m128i v = _mm_setzero_si128();
        v = _mm_cmpgt_epi64(v,v);
        if (_mm_test_all_zeros(v, v)) return 0;
        return 1;
      }"
    SUPPORT_SSE42_BUILD)

Tencent/Forward source/third_party/hdf5/config/cmake/HDF5UseFortran.cmake :522

check_c_source_runs (${PROG_SRC} PROG_OUTPUT)

ggml-org/ggml src/ggml-cpu/cmake/FindSIMD.cmake :61

check_c_source_runs("${${type}_CODE}" HAS_${type}_${__FLAG_I})

fluffos/fluffos src/thirdparty/libevent/cmake/CheckWorkingKqueue.cmake :3

check_c_source_runs(
"
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/event.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

int
main(int argc, char **argv)
{
    int kq;
    int n;
    int fd[2];
    struct kevent ev;
    struct timespec ts;
    char buf[80000];

    if (pipe(fd) == -1)
        exit(1);
    if (fcntl(fd[1], F_SETFL, O_NONBLOCK) == -1)
        exit(1);

    while ((n = write(fd[1], buf, sizeof(buf))) == sizeof(buf))
        ;

    if ((kq = kqueue()) == -1)
        exit(1);

    memset(&ev, 0, sizeof(ev));
    ev.ident = fd[1];
    ev.filter = EVFILT_WRITE;
    ev.flags = EV_ADD | EV_ENABLE;
    n = kevent(kq, &ev, 1, NULL, 0, NULL);
    if (n == -1)
        exit(1);

    read(fd[0], buf, sizeof(buf));

    ts.tv_sec = 0;
    ts.tv_nsec = 0;
    n = kevent(kq, NULL, 0, &ev, 1, &ts);
    if (n == -1 || n == 0)
        exit(1);

    exit(0);
}

" EVENT__HAVE_WORKING_KQUEUE)

micmacIGN/micmac MMVII/ExternalInclude/eigen-3.4.0/cmake/FindPTSCOTCH.cmake :401

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

GreatSQL/GreatSQL configure.cmake :315

CHECK_C_SOURCE_RUNS("
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sched.h>
int main()
{
  (void)setns(0, 0);
  return 0;
}" HAVE_SETNS)

percona/percona-xtradb-cluster configure.cmake :320

CHECK_C_SOURCE_RUNS("
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sched.h>
int main()
{
  (void)setns(0, 0);
  return 0;
}" HAVE_SETNS)

live-clones/gmsh contrib/eigen/cmake/FindPTSCOTCH.cmake :401

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

alibaba/AliSQLBackup configure.cmake :914

CHECK_C_SOURCE_RUNS("
  int main()
  { 
    __asm__ __volatile__ (\"pause\"); 
    return 0;
  }"  HAVE_PAUSE_INSTRUCTION)

glKarin/com.n0n3m4.diii4a Q3E/src/main/jni/deplibs/curl/CMakeLists.txt :1329

check_c_source_runs("
    int main(int argc, char **argv)
    {
      (void)argc;
      argv[0][0] = ' ';
      return (argv[0][0] == ' ')?0:1;
    }" HAVE_WRITABLE_ARGV)

fabsig/GPBoost external_libs/eigen/cmake/FindPTSCOTCH.cmake :402

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

pism/pism CMake/FindUDUNITS2.cmake :68

check_c_source_runs("${UDUNITS2_TEST_SRC}" UDUNITS2_WORKS_WITHOUT_LEXPAT)

orbbec/OrbbecSDK_v2 3rdparty/libjpeg/src/CMakeLists.txt :440

check_c_source_runs("
      #include <stdio.h>
      #include <stdlib.h>
      int is_shifting_signed (long arg) {
        long res = arg >> 4;
        if (res == -0x7F7E80CL)
          return 1; /* right shift is signed */
        /* see if unsigned-shift hack will fix it. */
        /* we can't just test exact value since it depends on width of long... */
        res |= (~0L) << (32-4);
        if (res == -0x7F7E80CL)
          return 0; /* right shift is unsigned */
        printf(\"Right shift isn't acting as I expect it to.\\\\n\");
        printf(\"I fear the JPEG software will not work at all.\\\\n\\\\n\");
        return 0; /* try it with unsigned anyway */
      }
      int main (void) {
        exit(is_shifting_signed(-0x7F7E80B1L));
      }" RIGHT_SHIFT_IS_UNSIGNED)

percona/percona-server configure.cmake :319

CHECK_C_SOURCE_RUNS("
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sched.h>
int main()
{
  (void)setns(0, 0);
  return 0;
}" HAVE_SETNS)

torch/DEPRECEATED-torch7-distro lib/TH/CMakeLists.txt :61

CHECK_C_SOURCE_RUNS("
       static inline int static_foo()
       {
         return 0;
       }

       int main(int argc, char *argv[])
       {
         static_foo();
         return 0;
       }" C_HAS_${KEYWORD})

libsndfile/libsamplerate cmake/ClipMode.cmake :23

check_c_source_runs(
      "
      #include <math.h>
      int main (void)
      {   double  fval ;
          int k, ival ;

          fval = 1.0 * 0x7FFFFFFF ;
          for (k = 0 ; k < 100 ; k++)
          {   ival = (lrint (fval)) >> 24 ;
              if (ival != 127)
                  return 1 ;

              fval *= 1.2499999 ;
              } ;

              return 0 ;
          }
      "
      CPU_CLIPS_POSITIVE)

fluent/fluent-bit lib/monkey/mk_core/deps/libevent/cmake/CheckWaitpidSupportWNOWAIT.cmake :3

check_c_source_runs(
"
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>

int
main(int argc, char** argv)
{
    pid_t pid;
    int status;
    if ((pid = fork()) == 0) _exit(0);
    _exit(waitpid(pid, &status, WNOWAIT) == -1);
}"
EVENT__HAVE_WAITPID_WITH_WNOWAIT)

libarchive/libarchive CMakeLists.txt :398

CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR})

MmgTools/mmg cmake/modules/FindSCOTCH.cmake :349

check_c_source_runs("${SCOTCH_C_TEST_SCOTCH_Num_4}" SCOTCH_Num_4)

nvMcJohn/apitest thirdparty/SDL2-2.0.1/cmake/sdlchecks.cmake :648

check_c_source_runs("
        #include <pthread.h>
        int main(int argc, char** argv) {
          pthread_attr_t type;
          pthread_attr_init(&type);
          return 0;
        }" HAVE_PTHREADS)

boundary/wireshark cmake/modules/CheckCLinkerFlag.cmake :20

CHECK_C_SOURCE_RUNS("int main() { return 0;}" ${_RESULT})

awslabs/aws-c-common cmake/AwsFeatureTests.cmake :25

check_c_source_runs("
    #include <stdbool.h>
    bool foo(int a, int b, int *c) {
        return __builtin_mul_overflow(a, b, c);
    }

    int main() {
        int out;
        if (foo(1, 2, &out)) {
            return 0;
        }

        return 0;
    }" AWS_HAVE_GCC_OVERFLOW_MATH_EXTENSIONS)

PacktPublishing/The-Modern-Cpp-Challenge libs/curl/CMake/OtherTests.cmake :188

check_c_source_runs("
    #ifdef HAVE_SYS_POLL_H
    #  include <sys/poll.h>
    #endif
    int main(void) {
      return poll((void *)0, 0, 10 /*ms*/);
    }" HAVE_POLL_FINE)

oofem/oofem cmake/Modules/FindPackageMultipass.cmake :97

check_c_source_runs ("${source}" ${testname})

skylersaleh/SkyEmu src/curl/CMakeLists.txt :1318

check_c_source_runs("
    int main(int argc, char **argv)
    {
      (void)argc;
      argv[0][0] = ' ';
      return (argv[0][0] == ' ')?0:1;
    }" HAVE_WRITABLE_ARGV)

joedrago/colorist ext/libjpeg-turbo/CMakeLists.txt :396

check_c_source_runs("
      #include <stdio.h>
      #include <stdlib.h>
      int is_shifting_signed (long arg) {
        long res = arg >> 4;
        if (res == -0x7F7E80CL)
          return 1; /* right shift is signed */
        /* see if unsigned-shift hack will fix it. */
        /* we can't just test exact value since it depends on width of long... */
        res |= (~0L) << (32-4);
        if (res == -0x7F7E80CL)
          return 0; /* right shift is unsigned */
        printf(\"Right shift isn't acting as I expect it to.\\\\n\");
        printf(\"I fear the JPEG software will not work at all.\\\\n\\\\n\");
        return 0; /* try it with unsigned anyway */
      }
      int main (void) {
        exit(is_shifting_signed(-0x7F7E80B1L));
      }" RIGHT_SHIFT_IS_UNSIGNED)

librsync/librsync CMakeLists.txt :124

check_c_source_runs("#include <stdio.h>\nint main(){char o[8];sprintf(o, \"%zu\", (size_t)7);return o[0] != '7';}" HAVE_PRINTF_Z)

openpnp/openpnp-capture linux/contrib/libjpeg-turbo-dev/CMakeLists.txt :381

check_c_source_runs("
      #include <stdio.h>
      #include <stdlib.h>
      int is_shifting_signed (long arg) {
        long res = arg >> 4;
        if (res == -0x7F7E80CL)
          return 1; /* right shift is signed */
        /* see if unsigned-shift hack will fix it. */
        /* we can't just test exact value since it depends on width of long... */
        res |= (~0L) << (32-4);
        if (res == -0x7F7E80CL)
          return 0; /* right shift is unsigned */
        printf(\"Right shift isn't acting as I expect it to.\\\\n\");
        printf(\"I fear the JPEG software will not work at all.\\\\n\\\\n\");
        return 0; /* try it with unsigned anyway */
      }
      int main (void) {
        exit(is_shifting_signed(-0x7F7E80B1L));
      }" RIGHT_SHIFT_IS_UNSIGNED)

ucla-vision/xivo thirdparty/eigen/cmake/FindPTSCOTCH.cmake :402

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

AXErunners/axe src/immer/cmake/FindBoehmGC.cmake :70

CHECK_C_SOURCE_RUNS(
    "#include <gc.h>
int main() {
int i= GC_get_parallel();
return 0;
}
" GC_GET_PARALLEL_WORKS)

zeromq/zeromq4-x builds/cmake/Modules/ZMQSourceRunChecks.cmake :5

check_c_source_runs(
    "
#include <sys/types.h>
#include <sys/socket.h>

int main(int argc, char *argv [])
{
    int s = socket(PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
    return(s == -1);
}
"
    ZMQ_HAVE_SOCK_CLOEXEC)

zeromq/zeromq4-1 builds/cmake/Modules/ZMQSourceRunChecks.cmake :5

check_c_source_runs(
    "
#include <sys/types.h>
#include <sys/socket.h>

int main(int argc, char *argv [])
{
    int s = socket(PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
    return(s == -1);
}
"
    ZMQ_HAVE_SOCK_CLOEXEC)

slicol/Games101-Homework-Win eigen3/cmake/FindPTSCOTCH.cmake :402

check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)

CTSRD-CHERI/cheribsd contrib/libevent/cmake/CheckWorkingKqueue.cmake :3

check_c_source_runs(
"
#include <sys/types.h>
#include <sys/time.h>
#include <sys/event.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

int
main(int argc, char **argv)
{
    int kq;
    int n;
    int fd[2];
    struct kevent ev;
    struct timespec ts;
    char buf[80000];

    if (pipe(fd) == -1)
        exit(1);
    if (fcntl(fd[1], F_SETFL, O_NONBLOCK) == -1)
        exit(1);

    while ((n = write(fd[1], buf, sizeof(buf))) == sizeof(buf))
        ;

    if ((kq = kqueue()) == -1)
        exit(1);

    memset(&ev, 0, sizeof(ev));
    ev.ident = fd[1];
    ev.filter = EVFILT_WRITE;
    ev.flags = EV_ADD | EV_ENABLE;
    n = kevent(kq, &ev, 1, NULL, 0, NULL);
    if (n == -1)
        exit(1);

    read(fd[0], buf, sizeof(buf));

    ts.tv_sec = 0;
    ts.tv_nsec = 0;
    n = kevent(kq, NULL, 0, &ev, 1, &ts);
    if (n == -1 || n == 0)
        exit(1);

    exit(0);
}

" EVENT__HAVE_WORKING_KQUEUE)

TimoLassmann/kalign CMakeLists.txt :106

check_c_source_runs("
        #include <emmintrin.h>
        #include <smmintrin.h>
        int main()
        {
        __m128i a = _mm_setzero_si128();
        __m128i b = _mm_minpos_epu16(a);
        return 0;
        }"
      HAVE_SSE)

arkdb/arkproxy configure.cmake :770

CHECK_C_SOURCE_RUNS("
  int main()
  { 
    __asm__ __volatile__ (\"pause\"); 
    return 0;
  }"  HAVE_PAUSE_INSTRUCTION)

mongodb/mongo-bi-connector-odbc-driver configure.cmake :676

CHECK_C_SOURCE_RUNS("
      int main()
      {
        __asm__ __volatile__ (\"pause\");
        return 0;
      }"  HAVE_PAUSE_INSTRUCTION)

merzlab/QUICK cmake/jedbrown/FindPackageMultipass.cmake :97

check_c_source_runs ("${source}" ${testname})

erthink/libmdbx cmake/compiler.cmake :343

check_c_source_runs("int main(void) { return 0; }" CMAKE_HOST_CAN_RUN_EXECUTABLES_BUILT_FOR_TARGET)

DynamoRIO/dynamorio make/utils.cmake :185

check_c_source_runs("${avx_prog}" proc_found_avx)

monkey/monkey mk_core/deps/libevent/cmake/CheckWaitpidSupportWNOWAIT.cmake :3

check_c_source_runs(
"
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>

int
main(int argc, char** argv)
{
    pid_t pid;
    int status;
    if ((pid = fork()) == 0) _exit(0);
    _exit(waitpid(pid, &status, WNOWAIT) == -1);
}"
EVENT__HAVE_WAITPID_WITH_WNOWAIT)

Dillonb/n64 src/contrib/libsamplerate/cmake/ClipMode.cmake :23

check_c_source_runs(
      "
      #include <math.h>
      int main (void)
      {   double  fval ;
          int k, ival ;

          fval = 1.0 * 0x7FFFFFFF ;
          for (k = 0 ; k < 100 ; k++)
          {   ival = (lrint (fval)) >> 24 ;
              if (ival != 127)
                  return 1 ;

              fval *= 1.2499999 ;
              } ;

              return 0 ;
          }
      "
      CPU_CLIPS_POSITIVE)

mozilla/mozjpeg CMakeLists.txt :476

check_c_source_runs("
      #include <stdio.h>
      #include <stdlib.h>
      static int is_shifting_signed (long arg) {
        long res = arg >> 4;
        if (res == -0x7F7E80CL)
          return 1; /* right shift is signed */
        /* see if unsigned-shift hack will fix it. */
        /* we can't just test exact value since it depends on width of long... */
        res |= 0xFFFFFFFFL << (32-4);
        if (res == -0x7F7E80CL)
          return 0; /* right shift is unsigned */
        printf(\"Right shift isn't acting as I expect it to.\\\\n\");
        printf(\"I fear the JPEG software will not work at all.\\\\n\\\\n\");
        return 0; /* try it with unsigned anyway */
      }
      int main (void) {
        exit(is_shifting_signed(-0x7F7E80B1L));
      }" RIGHT_SHIFT_IS_UNSIGNED)

GNOME/evolution CMakeLists.txt :385

CHECK_C_SOURCE_RUNS("#define ICONV_DETECT_BUILD_DIR \"${_binary_dir_with_separator}\"
		     #include \"${CMAKE_SOURCE_DIR}/iconv-detect.c\"" _correct_iconv)

RIKEN-SysSoft/mckernel cmake/modules/AutoconfHelper.cmake :128

CHECK_C_SOURCE_RUNS("
#include <sys/types.h>
#define BIG_OFF_T (((off_t)1<<62)-1+((off_t)1<<62))
int main (int argc, char **argv) {
    int big_off_t=((BIG_OFF_T%2147483629==721) &&
                   (BIG_OFF_T%2147483647==1));
    return big_off ? 0 : 1;
}
" HAVE_LARGE_FILE_SUPPORT)