diff --git a/cmake/CheckAtomic.cmake b/cmake/CheckAtomic.cmake index 609e230d4..718183b15 100644 --- a/cmake/CheckAtomic.cmake +++ b/cmake/CheckAtomic.cmake @@ -27,9 +27,12 @@ function(check_working_cxx_atomics varname) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11") CHECK_CXX_SOURCE_COMPILES(" #include -std::atomic x; +#include +std::atomic x1; +std::atomic x2; +std::atomic x3; int main() { - return x; + return ++x1 + ++x2 + ++x3; } " ${varname}) set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})