Skip to content

Commit 6230d47

Browse files
committed
Merge #214: cmake: Port PR30137 from the master branch
af7c6ed fixup! cmake: Build `bitcoin_util` static library (Hennadii Stepanov) Pull request description: This PR ports bitcoin#30137. The `target_compile_definitions` command is to be deleted during the next sync/rebase round. Such an early porting is needed for #93 in order to delete the only non-config related generator expression from the compile definitions, which simplifies the summary code a lot. Effectively, this commit has been split from #93. Top commit has no ACKs. Tree-SHA512: 0062abb77fea3c1f6800452a0a0c9bff39cc357b09e3f2a0e25eaa9961faad515b493dd3f6f217edcb5d43830cd16d953b99ae52c02a3a2fe56fc911dcf79154
2 parents 06872ef + af7c6ed commit 6230d47

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ if(WITH_BDB)
104104
endif()
105105
cmake_dependent_option(BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ${BUILD_TESTS} "ENABLE_WALLET" OFF)
106106

107-
option(ENABLE_THREADLOCAL "Enable features that depend on the C++ thread_local keyword (currently just thread names in debug logs)." ON)
108107
option(ENABLE_HARDENING "Attempt to harden the resulting executables." ON)
109108
option(REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting executables." OFF)
110109
option(WERROR "Treat compiler warnings as errors." OFF)

cmake/module/AddThreadsIfNeeded.cmake

+1-21
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,5 @@ function(add_threads_if_needed)
1818
set(THREADS_PREFER_PTHREAD_FLAG ON)
1919
find_package(Threads REQUIRED)
2020
set_target_properties(Threads::Threads PROPERTIES IMPORTED_GLOBAL TRUE)
21-
22-
if(MINGW)
23-
#[=[
24-
mingw32's implementation of thread_local has been shown to behave
25-
erroneously under concurrent usage.
26-
See:
27-
- https://github.com/bitcoin/bitcoin/pull/15849
28-
- https://gist.github.com/jamesob/fe9a872051a88b2025b1aa37bfa98605
29-
]=]
30-
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
31-
#[=[
32-
FreeBSD's implementation of thread_local is buggy.
33-
See:
34-
- https://github.com/bitcoin/bitcoin/pull/16059
35-
- https://groups.google.com/d/msg/bsdmailinglist/22ncTZAbDp4/Dii_pII5AwAJ
36-
]=]
37-
elseif(ENABLE_THREADLOCAL)
38-
target_compile_definitions(core_interface INTERFACE
39-
"$<$<COMPILE_FEATURES:cxx_thread_local>:HAVE_THREAD_LOCAL>"
40-
)
41-
endif()
21+
target_compile_definitions(core_interface INTERFACE HAVE_THREAD_LOCAL)
4222
endfunction()

0 commit comments

Comments
 (0)