cmake: export <atomic> availability (fixes #667)

This commit is contained in:
Sergiu Deitsch 2021-06-15 18:30:44 +02:00
parent c1499f64a8
commit d25a1b7bc0
3 changed files with 9 additions and 2 deletions

View File

@ -398,6 +398,12 @@ if (HAVE_EXECINFO_H)
set (HAVE_STACKTRACE 1) set (HAVE_STACKTRACE 1)
endif (HAVE_EXECINFO_H) endif (HAVE_EXECINFO_H)
if (HAVE_CXX11_ATOMIC)
set (ac_cv_cxx11_atomic 1)
else (HAVE_CXX11_ATOMIC)
set (ac_cv_cxx11_atomic 0)
endif (HAVE_CXX11_ATOMIC)
if (WITH_SYMBOLIZE) if (WITH_SYMBOLIZE)
if (WIN32 OR CYGWIN) if (WIN32 OR CYGWIN)
cmake_push_check_state (RESET) cmake_push_check_state (RESET)

View File

@ -187,6 +187,7 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs):
) )
common_config = { common_config = {
"@ac_cv_cxx11_atomic@": "1",
"@ac_cv_cxx11_nullptr_t@": "1", "@ac_cv_cxx11_nullptr_t@": "1",
"@ac_cv_cxx_using_operator@": "1", "@ac_cv_cxx_using_operator@": "1",
"@ac_cv_have_inttypes_h@": "0", "@ac_cv_have_inttypes_h@": "0",

View File

@ -99,7 +99,7 @@
#include <gflags/gflags.h> #include <gflags/gflags.h>
#endif #endif
#ifdef HAVE_CXX11_ATOMIC #if @ac_cv_cxx11_atomic@
#include <atomic> #include <atomic>
#elif defined(OS_WINDOWS) #elif defined(OS_WINDOWS)
#include <Windows.h> #include <Windows.h>