summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorLucian Petrut <lpetrut@cloudbasesolutions.com>2023-05-30 15:46:54 +0200
committerLucian Petrut <lpetrut@cloudbasesolutions.com>2023-08-30 14:59:00 +0200
commit4b43afd509a4faf1354f96d5bf560bca5b08d5b9 (patch)
tree7b9facfc3d2a15315c7e7d51d391d9a79d219cf4 /CMakeLists.txt
parentcommon: avoid <1ms waits on Windows (diff)
downloadceph-4b43afd509a4faf1354f96d5bf560bca5b08d5b9.tar.xz
ceph-4b43afd509a4faf1354f96d5bf560bca5b08d5b9.zip
common: skip boost shared_mutex with mingw-llvm
Because of winpthreads issues, we had to use Boost's shared_mutex implementation. When using mingw-llvm, we can safely use libc++'s shared mutex implementation. Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 9 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1778a720264..ceffeccc29a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,15 +41,19 @@ if(WIN32)
# the targeted Windows version. The availability of certain functions and
# structures will depend on it.
set(WIN32_WINNT "0x0A00" CACHE STRING "Targeted Windows version.")
- # In order to avoid known winpthread issues, we're using the boost
- # shared mutex implementation.
- # https://github.com/msys2/MINGW-packages/issues/3319
add_definitions(
-D_WIN32_WINNT=${WIN32_WINNT}
-DFMT_USE_TZSET=0
- -DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
- -DBOOST_THREAD_V2_SHARED_MUTEX
)
+ # In order to avoid known winpthread issues, we're using the Boost
+ # shared mutex implementation. This isn't required with llvm/libc++.
+ # https://github.com/msys2/MINGW-packages/issues/3319
+ if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
+ add_definitions(
+ -DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
+ -DBOOST_THREAD_V2_SHARED_MUTEX
+ )
+ endif()
set(Boost_THREADAPI "win32")
endif()