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

feat: use standard mutexes #1015

Merged
merged 1 commit into from
Jan 1, 2024
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
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ if (Threads_FOUND)
set (CMAKE_REQUIRED_LIBRARIES Threads::Threads)
endif (Threads_FOUND)

check_cxx_symbol_exists (pthread_rwlock_destroy pthread.h HAVE_RWLOCK_DESTROY)
check_cxx_symbol_exists (pthread_rwlock_init pthread.h HAVE_RWLOCK_INIT)
check_cxx_symbol_exists (pthread_rwlock_rdlock pthread.h HAVE_RWLOCK_RDLOCK)
check_cxx_symbol_exists (pthread_rwlock_unlock pthread.h HAVE_RWLOCK_UNLOCK)
check_cxx_symbol_exists (pthread_rwlock_wrlock pthread.h HAVE_RWLOCK_WRLOCK)
check_cxx_symbol_exists (pthread_threadid_np pthread.h HAVE_PTHREAD_THREADID_NP)

cmake_pop_check_state ()
Expand Down Expand Up @@ -391,7 +386,6 @@ set (GLOG_SRCS
${GLOG_PUBLIC_H}
src/base/commandlineflags.h
src/base/googleinit.h
src/base/mutex.h
src/demangle.cc
src/demangle.h
src/logging.cc
Expand Down Expand Up @@ -440,6 +434,13 @@ set (glog_libraries_options_for_static_linking)
# CMake always uses the generated export header
target_compile_definitions (glog PUBLIC GLOG_USE_GLOG_EXPORT)

if (WIN32)
# Do not define min and max as macros
target_compile_definitions (glog PRIVATE NOMINMAX)
# Exclude unnecessary funcitonality
target_compile_definitions (glog PRIVATE WIN32_LEAN_AND_MEAN)
endif (WIN32)

if (HAVE_LIB_GFLAGS)
target_compile_definitions (glog PUBLIC GLOG_USE_GFLAGS)
endif (HAVE_LIB_GFLAGS)
Expand Down
3 changes: 1 addition & 2 deletions bazel/glog.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def glog_library(with_gflags = 1, **kwargs):
"-Wno-unused-function",
"-Wno-unused-local-typedefs",
"-Wno-unused-variable",
# Allows src/base/mutex.h to include pthread.h.
# Allows to include pthread.h.
"-DHAVE_PTHREAD",
# Allows src/logging.cc to determine the host name.
"-DHAVE_SYS_UTSNAME_H",
Expand Down Expand Up @@ -154,7 +154,6 @@ def glog_library(with_gflags = 1, **kwargs):
name = "shared_headers",
srcs = [
"src/base/commandlineflags.h",
"src/base/mutex.h",
"src/stacktrace.h",
"src/utilities.h",
]
Expand Down
Loading