File: itkCheckBuiltins.cmake

package info (click to toggle)
insighttoolkit4 4.13.3withdata-dfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 491,256 kB
  • sloc: cpp: 557,600; ansic: 180,546; fortran: 34,788; python: 16,572; sh: 2,187; lisp: 2,070; tcl: 993; java: 362; perl: 200; makefile: 133; csh: 81; pascal: 69; xml: 19; ruby: 10
file content (27 lines) | stat: -rw-r--r-- 1,285 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# check for gcc/clang atomic builtins like __sync_add_and_fetch
if(NOT WIN32 OR MINGW)
  if(EMSCRIPTEN)
    set(ITK_HAVE_SYNC_BUILTINS 0 CACHE INTERNAL "For __sync atomic builtins.")
  elseif(NOT DEFINED ITK_HAVE_SYNC_BUILTINS)
    message(STATUS "Checking for builtin __sync_add_and_fetch")
    try_compile(ITK_TEST_SYNC_BUILTINS_COMPILED
      ${ITK_BINARY_DIR}
      ${CMAKE_CURRENT_SOURCE_DIR}/CMake/itkCheckSyncBuiltins.cxx
      OUTPUT_VARIABLE OUTPUT)
    if(ITK_TEST_SYNC_BUILTINS_COMPILED)
      message(STATUS "Checking for builtin __sync_add_and_fetch -- success")
      set(ITK_HAVE_SYNC_BUILTINS 1 CACHE INTERNAL "For __sync atomic builtins.")
      file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
        "Determining if the C++ compiler supports __sync_add_and_fetch builtin "
        "passed with the following output:\n"
        "${OUTPUT}\n")
    else()
      message(STATUS "Checking for builtin __sync_add_and_fetch -- failed")
      set(ITK_HAVE_SYNC_BUILTINS 0 CACHE INTERNAL "For __sync atomic builtins.")
      file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
        "Determining if the C++ compiler supports __sync_add_and_fetch builtin "
        "failed with the following output:\n"
        "${OUTPUT}\n")
    endif()
  endif()
endif()