Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,12 @@ if (HAVE_EXECINFO_H)
set (HAVE_STACKTRACE 1)
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 (WIN32 OR CYGWIN)
cmake_push_check_state (RESET)
Expand Down Expand Up @@ -466,7 +472,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}
Expand Down
1 change: 1 addition & 0 deletions bazel/glog.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/glog/logging.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
#include <gflags/gflags.h>
#endif

#ifdef HAVE_CXX11_ATOMIC
#if @ac_cv_cxx11_atomic@
#include <atomic>
#elif defined(OS_WINDOWS)
#include <Windows.h>
Expand Down