diff options
Diffstat (limited to 'Source/Checks/cm_cxx_features.cmake')
-rw-r--r-- | Source/Checks/cm_cxx_features.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index f5b7587..98d5eff 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -17,6 +17,7 @@ function(cm_check_cxx_feature name) try_run(CMake_RUN_CXX_${FEATURE} CMake_COMPILE_CXX_${FEATURE} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/cm_cxx_${name}.cxx + LINK_LIBRARIES ${cm_check_cxx_feature_LINK_LIBRARIES} CMAKE_FLAGS ${maybe_cxx_standard} OUTPUT_VARIABLE OUTPUT ) @@ -29,6 +30,7 @@ function(cm_check_cxx_feature name) try_compile(CMake_HAVE_CXX_${FEATURE} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/cm_cxx_${name}.cxx + LINK_LIBRARIES ${cm_check_cxx_feature_LINK_LIBRARIES} CMAKE_FLAGS ${maybe_cxx_standard} OUTPUT_VARIABLE OUTPUT ) @@ -93,3 +95,12 @@ if (NOT CMAKE_CXX_STANDARD LESS "17") else() set(CMake_HAVE_CXX_FILESYSTEM FALSE) endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l|sparc") + cm_check_cxx_feature(atomic_builtin) + if(NOT CMake_HAVE_CXX_ATOMIC_BUILTIN) + set(cm_check_cxx_feature_LINK_LIBRARIES atomic) + cm_check_cxx_feature(atomic_lib) # defines CMake_HAVE_CXX_ATOMIC_LIB + unset(cm_check_cxx_feature_LINK_LIBRARIES) + endif() +endif() |