diff --git a/CMakeLists.txt b/CMakeLists.txt index 92592ec..8bfcd60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -644,7 +644,9 @@ if (NOT Windows) } ]=]) string(REPLACE "std::atomic" "std::atomic" ATOMICS64_TEST_SOURCE "${ATOMICS_TEST_SOURCE}") - + if(APPLE) + set(CMAKE_REQUIRED_FLAGS "-std=c++11") + endif() check_cxx_source_compiles("${ATOMICS_TEST_SOURCE}" HAVE_CXX_ATOMICS_WITHOUT_LIB) check_cxx_source_compiles("${ATOMICS64_TEST_SOURCE}" HAVE_CXX_ATOMICS64_WITHOUT_LIB) if((NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) OR (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)) @@ -659,6 +661,9 @@ if (NOT Windows) target_link_libraries(torrent-rasterbar PUBLIC atomic) endif() endif() + if(APPLE) + unset(CMAKE_REQUIRED_FLAGS) + endif() endif() feature_option(build_tests "build tests" OFF)