From 11f8aeac127c6f560fb1f1c9de7f5d2eb73600f3 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Tue, 15 Jun 2021 18:30:44 +0200 Subject: [PATCH] cmake: export `` availability (fixes #667) --- CMakeLists.txt | 6 +++++- bazel/glog.bzl | 1 + src/glog/logging.h.in | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70050037c..e68261c99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -398,6 +398,10 @@ if (HAVE_EXECINFO_H) set (HAVE_STACKTRACE 1) endif (HAVE_EXECINFO_H) +if (HAVE_CXX11_ATOMIC) + set (ac_cv_cxx11_atomic 1) +endif (HAVE_CXX11_ATOMIC) + if (WITH_SYMBOLIZE) if (WIN32 OR CYGWIN) cmake_push_check_state (RESET) @@ -466,7 +470,7 @@ else (WITH_THREADS AND Threads_FOUND) set (NO_THREADS 1) endif (WITH_THREADS AND Threads_FOUND) -# fopen/open on Cygwin can not handle unix-type paths like /home/.... +# fopen/open on Cygwin can not handle unix-type paths like /home/.... # therefore we translate TEST_SRC_DIR to windows-path. if (CYGWIN) execute_process (COMMAND cygpath.exe -m ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/bazel/glog.bzl b/bazel/glog.bzl index 40833b461..69c4517bc 100644 --- a/bazel/glog.bzl +++ b/bazel/glog.bzl @@ -187,6 +187,7 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs): ) common_config = { + "@ac_cv_cxx11_atomic@": "1", "@ac_cv_cxx11_nullptr_t@": "1", "@ac_cv_cxx_using_operator@": "1", "@ac_cv_have_inttypes_h@": "0", diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in index a9b0d461d..bb7c3f8b5 100644 --- a/src/glog/logging.h.in +++ b/src/glog/logging.h.in @@ -99,7 +99,7 @@ #include #endif -#ifdef HAVE_CXX11_ATOMIC +#if @ac_cv_have_cxx11_atomic@ #include #elif defined(OS_WINDOWS) #include