v29.4-roots.3 · Commit 1: [PATCH 01/30] build: port platform and dependency support
CMakeLists.txt
Before: CMakeLists.txt · After: CMakeLists.txt
File metadata
index 46980b32db8962c39ada7536d60d65ae814128e7..84f22c14968dd6fd6afb14d4ae05a7628b4fe844 100644
Download original patch · Release notes
Diff rows 1–276 of 276. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
CMakeLists.txt
CHANGED
|
@@ -57,15 +57,15 @@ project(BitcoinCore
|
|
| 57 |
LANGUAGES NONE
|
| 58 |
)
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
set(CLIENT_VERSION_STRING ${PROJECT_VERSION})
|
| 61 |
if(CLIENT_VERSION_RC GREATER 0)
|
| 62 |
string(APPEND CLIENT_VERSION_STRING "rc${CLIENT_VERSION_RC}")
|
| 63 |
endif()
|
| 64 |
|
| 65 |
-
set(COPYRIGHT_HOLDERS "The %s developers")
|
| 66 |
-
set(COPYRIGHT_HOLDERS_FINAL "The ${CLIENT_NAME} developers")
|
| 67 |
-
set(CLIENT_BUGREPORT "https://github.com/bitcoin/bitcoin/issues")
|
| 68 |
-
|
| 69 |
#=============================
|
| 70 |
# Language setup
|
| 71 |
#=============================
|
|
@@ -96,6 +96,8 @@ include(CMakeDependentOption)
|
|
| 96 |
# When adding a new option, end the <help_text> with a full stop for consistency.
|
| 97 |
option(BUILD_DAEMON "Build bitcoind executable." ON)
|
| 98 |
option(BUILD_GUI "Build bitcoin-qt executable." OFF)
|
|
|
|
|
|
|
| 99 |
option(BUILD_CLI "Build bitcoin-cli executable." ON)
|
| 100 |
|
| 101 |
option(BUILD_TESTS "Build test_bitcoin executable." ON)
|
|
@@ -105,6 +107,55 @@ option(BUILD_UTIL "Build bitcoin-util executable." ${BUILD_TESTS})
|
|
| 105 |
option(BUILD_UTIL_CHAINSTATE "Build experimental bitcoin-chainstate executable." OFF)
|
| 106 |
option(BUILD_KERNEL_LIB "Build experimental bitcoinkernel library." ${BUILD_UTIL_CHAINSTATE})
|
| 107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
option(ENABLE_WALLET "Enable wallet." ON)
|
| 109 |
option(WITH_SQLITE "Enable SQLite wallet support." ${ENABLE_WALLET})
|
| 110 |
if(WITH_SQLITE)
|
|
@@ -130,7 +181,7 @@ if(WITH_BDB)
|
|
| 130 |
"BDB (legacy) wallets opened by this build will not be portable!"
|
| 131 |
)
|
| 132 |
if(WARN_INCOMPATIBLE_BDB)
|
| 133 |
-
message(WARNING "If this is intended, pass \"-DWARN_INCOMPATIBLE_BDB=OFF\".\n"
|
| 134 |
"Passing \"-DWITH_BDB=OFF\" will suppress this warning."
|
| 135 |
)
|
| 136 |
endif()
|
|
@@ -143,6 +194,11 @@ option(REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting execu
|
|
| 143 |
option(WERROR "Treat compiler warnings as errors." OFF)
|
| 144 |
option(WITH_CCACHE "Attempt to use ccache for compiling." ON)
|
| 145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
option(WITH_ZMQ "Enable ZMQ notifications." OFF)
|
| 147 |
if(WITH_ZMQ)
|
| 148 |
find_package(ZeroMQ 4.0.0 MODULE REQUIRED)
|
|
@@ -153,7 +209,9 @@ if(WITH_USDT)
|
|
| 153 |
find_package(USDT MODULE REQUIRED)
|
| 154 |
endif()
|
| 155 |
|
| 156 |
-
cmake_dependent_option(ENABLE_EXTERNAL_SIGNER "Enable external signer support." ON "NOT WIN32" OFF)
|
|
|
|
|
|
|
| 157 |
|
| 158 |
cmake_dependent_option(WITH_QRENCODE "Enable QR code support." ON "BUILD_GUI" OFF)
|
| 159 |
if(WITH_QRENCODE)
|
|
@@ -163,7 +221,9 @@ endif()
|
|
| 163 |
|
| 164 |
cmake_dependent_option(WITH_DBUS "Enable DBus support." ON "NOT CMAKE_SYSTEM_NAME MATCHES \"(Windows|Darwin)\" AND BUILD_GUI" OFF)
|
| 165 |
|
| 166 |
-
option(WITH_MULTIPROCESS "Build multiprocess bitcoin-node and bitcoin-gui executables in addition to monolithic bitcoind and bitcoin-qt executables. Requires libmultiprocess library. Experimental." OFF)
|
|
|
|
|
|
|
| 167 |
if(WITH_MULTIPROCESS)
|
| 168 |
find_package(Libmultiprocess REQUIRED COMPONENTS Lib)
|
| 169 |
find_package(LibmultiprocessNative REQUIRED COMPONENTS Bin
|
|
@@ -181,12 +241,21 @@ if(BUILD_GUI)
|
|
| 181 |
list(APPEND qt_components DBus)
|
| 182 |
set(USE_DBUS TRUE)
|
| 183 |
endif()
|
|
|
|
|
|
|
|
|
|
| 184 |
if(BUILD_GUI_TESTS)
|
| 185 |
list(APPEND qt_components Test)
|
| 186 |
endif()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
find_package(Qt 5.11.3 MODULE REQUIRED
|
| 188 |
COMPONENTS ${qt_components}
|
| 189 |
)
|
|
|
|
| 190 |
unset(qt_components)
|
| 191 |
endif()
|
| 192 |
|
|
@@ -233,6 +302,7 @@ if(BUILD_FOR_FUZZING)
|
|
| 233 |
set(BUILD_WALLET_TOOL OFF)
|
| 234 |
set(BUILD_GUI OFF)
|
| 235 |
set(ENABLE_EXTERNAL_SIGNER OFF)
|
|
|
|
| 236 |
set(WITH_ZMQ OFF)
|
| 237 |
set(BUILD_TESTS OFF)
|
| 238 |
set(BUILD_GUI_TESTS OFF)
|
|
@@ -244,9 +314,20 @@ if(BUILD_FOR_FUZZING)
|
|
| 244 |
)
|
| 245 |
endif()
|
| 246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 247 |
include(TryAppendCXXFlags)
|
| 248 |
include(TryAppendLinkerFlag)
|
| 249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
# Redefine/adjust per-configuration flags.
|
| 251 |
target_compile_definitions(core_interface_debug INTERFACE
|
| 252 |
DEBUG
|
|
@@ -318,6 +399,13 @@ if(WIN32)
|
|
| 318 |
# As a best effort, target Windows 8.
|
| 319 |
try_append_linker_flag("-Wl,--major-subsystem-version,6" TARGET core_interface)
|
| 320 |
try_append_linker_flag("-Wl,--minor-subsystem-version,2" TARGET core_interface)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 321 |
endif()
|
| 322 |
|
| 323 |
# Workaround producing large object files, which cannot be handled by the assembler.
|
|
@@ -413,8 +501,12 @@ if(BUILD_DAEMON OR BUILD_GUI OR BUILD_CLI OR BUILD_TESTS OR BUILD_BENCH OR BUILD
|
|
| 413 |
find_package(Libevent 2.1.8 MODULE REQUIRED)
|
| 414 |
endif()
|
| 415 |
|
|
|
|
|
|
|
| 416 |
include(cmake/introspection.cmake)
|
| 417 |
|
|
|
|
|
|
|
| 418 |
include(cmake/ccache.cmake)
|
| 419 |
|
| 420 |
add_library(warn_interface INTERFACE)
|
|
@@ -451,7 +543,7 @@ else()
|
|
| 451 |
try_append_cxx_flags("-Woverloaded-virtual" TARGET warn_interface SKIP_LINK)
|
| 452 |
try_append_cxx_flags("-Wsuggest-override" TARGET warn_interface SKIP_LINK)
|
| 453 |
try_append_cxx_flags("-Wimplicit-fallthrough" TARGET warn_interface SKIP_LINK)
|
| 454 |
-
try_append_cxx_flags("-Wunreachable-code" TARGET warn_interface SKIP_LINK)
|
| 455 |
try_append_cxx_flags("-Wdocumentation" TARGET warn_interface SKIP_LINK)
|
| 456 |
try_append_cxx_flags("-Wself-assign" TARGET warn_interface SKIP_LINK)
|
| 457 |
try_append_cxx_flags("-Wbidi-chars=any" TARGET warn_interface SKIP_LINK)
|
|
@@ -570,6 +662,7 @@ if(WERROR)
|
|
| 570 |
unset(werror_flag)
|
| 571 |
endif()
|
| 572 |
|
|
|
|
| 573 |
# Prefer Unix-style package components over frameworks on macOS.
|
| 574 |
# This improves compatibility with Python version managers.
|
| 575 |
set(Python3_FIND_FRAMEWORK LAST CACHE STRING "")
|
|
@@ -577,7 +670,11 @@ set(Python3_FIND_FRAMEWORK LAST CACHE STRING "")
|
|
| 577 |
# improves compatibility with Python version managers that use shims.
|
| 578 |
set(Python3_FIND_UNVERSIONED_NAMES FIRST CACHE STRING "")
|
| 579 |
mark_as_advanced(Python3_FIND_FRAMEWORK Python3_FIND_UNVERSIONED_NAMES)
|
|
|
|
|
|
|
|
|
|
| 580 |
find_package(Python3 3.10 COMPONENTS Interpreter)
|
|
|
|
| 581 |
if(Python3_EXECUTABLE)
|
| 582 |
set(PYTHON_COMMAND ${Python3_EXECUTABLE})
|
| 583 |
else()
|
|
@@ -586,6 +683,17 @@ else()
|
|
| 586 |
)
|
| 587 |
endif()
|
| 588 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 589 |
target_compile_definitions(core_interface INTERFACE ${DEPENDS_COMPILE_DEFINITIONS})
|
| 590 |
target_compile_definitions(core_interface_relwithdebinfo INTERFACE ${DEPENDS_COMPILE_DEFINITIONS_RELWITHDEBINFO})
|
| 591 |
target_compile_definitions(core_interface_debug INTERFACE ${DEPENDS_COMPILE_DEFINITIONS_DEBUG})
|
|
@@ -618,7 +726,6 @@ endif()
|
|
| 618 |
if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
| 619 |
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
| 620 |
else()
|
| 621 |
-
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
| 622 |
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
|
| 623 |
endif()
|
| 624 |
add_subdirectory(test)
|
|
@@ -644,14 +751,21 @@ if(BUILD_DAEMON AND WITH_MULTIPROCESS)
|
|
| 644 |
else()
|
| 645 |
set(bitcoin_daemon_status OFF)
|
| 646 |
endif()
|
| 647 |
-
message(" bitcoin-node (multiprocess) ......... ${bitcoin_daemon_status}")
|
| 648 |
-
message(" bitcoin-qt (GUI) .................... ${BUILD_GUI}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 649 |
if(BUILD_GUI AND WITH_MULTIPROCESS)
|
| 650 |
set(bitcoin_gui_status ON)
|
| 651 |
else()
|
| 652 |
set(bitcoin_gui_status OFF)
|
| 653 |
endif()
|
| 654 |
-
message(" bitcoin-gui (GUI, multiprocess) ..... ${bitcoin_gui_status}")
|
| 655 |
message(" bitcoin-cli ......................... ${BUILD_CLI}")
|
| 656 |
message(" bitcoin-tx .......................... ${BUILD_TX}")
|
| 657 |
message(" bitcoin-util ........................ ${BUILD_UTIL}")
|
|
@@ -665,6 +779,8 @@ if(ENABLE_WALLET)
|
|
| 665 |
message(" - legacy wallets (Berkeley DB) ..... ${WITH_BDB}")
|
| 666 |
endif()
|
| 667 |
message(" external signer ..................... ${ENABLE_EXTERNAL_SIGNER}")
|
|
|
|
|
|
|
| 668 |
message(" ZeroMQ .............................. ${WITH_ZMQ}")
|
| 669 |
message(" USDT tracing ........................ ${WITH_USDT}")
|
| 670 |
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
|
|
|
|
| 57 |
LANGUAGES NONE
|
| 58 |
)
|
| 59 |
|
| 60 |
+
set(COPYRIGHT_HOLDERS "The %s developers")
|
| 61 |
+
set(COPYRIGHT_HOLDERS_FINAL "The ${CLIENT_NAME} developers")
|
| 62 |
+
set(CLIENT_BUGREPORT "https://github.com/bitcoin/bitcoin/issues")
|
| 63 |
+
|
| 64 |
set(CLIENT_VERSION_STRING ${PROJECT_VERSION})
|
| 65 |
if(CLIENT_VERSION_RC GREATER 0)
|
| 66 |
string(APPEND CLIENT_VERSION_STRING "rc${CLIENT_VERSION_RC}")
|
| 67 |
endif()
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
#=============================
|
| 70 |
# Language setup
|
| 71 |
#=============================
|
|
|
|
| 96 |
# When adding a new option, end the <help_text> with a full stop for consistency.
|
| 97 |
option(BUILD_DAEMON "Build bitcoind executable." ON)
|
| 98 |
option(BUILD_GUI "Build bitcoin-qt executable." OFF)
|
| 99 |
+
set(WITH_QT_VERSION "5" CACHE STRING "Choose 5 or 6.")
|
| 100 |
+
set_property(CACHE WITH_QT_VERSION PROPERTY STRINGS "5" "6")
|
| 101 |
option(BUILD_CLI "Build bitcoin-cli executable." ON)
|
| 102 |
|
| 103 |
option(BUILD_TESTS "Build test_bitcoin executable." ON)
|
|
|
|
| 107 |
option(BUILD_UTIL_CHAINSTATE "Build experimental bitcoin-chainstate executable." OFF)
|
| 108 |
option(BUILD_KERNEL_LIB "Build experimental bitcoinkernel library." ${BUILD_UTIL_CHAINSTATE})
|
| 109 |
|
| 110 |
+
option(WITH_SYSTEM_LEVELDB "Build with system LevelDB instead of embedded fork." OFF)
|
| 111 |
+
mark_as_advanced(WITH_SYSTEM_LEVELDB)
|
| 112 |
+
if(WITH_SYSTEM_LEVELDB)
|
| 113 |
+
find_package(LevelDB MODULE REQUIRED)
|
| 114 |
+
else()
|
| 115 |
+
set(EMBEDDED_LEVELDB TRUE)
|
| 116 |
+
endif() # WITH_SYSTEM_LEVELDB
|
| 117 |
+
|
| 118 |
+
option(WITH_SYSTEM_LIBSECP256K1 "Build with system libsecp256k1 instead of embedded copy." OFF)
|
| 119 |
+
mark_as_advanced(WITH_SYSTEM_LIBSECP256K1)
|
| 120 |
+
if(WITH_SYSTEM_LIBSECP256K1)
|
| 121 |
+
find_package(PkgConfig REQUIRED)
|
| 122 |
+
pkg_check_modules(libsecp256k1 REQUIRED IMPORTED_TARGET libsecp256k1)
|
| 123 |
+
add_library(secp256k1 ALIAS PkgConfig::libsecp256k1)
|
| 124 |
+
|
| 125 |
+
if(NOT (libsecp256k1_HAS_SECP256K1_ELLSWIFT_CREATE AND libsecp256k1_HAS_SECP256K1_XONLY_PUBKEY_PARSE AND libsecp256k1_HAS_SECP256K1_ECDSA_RECOVER AND libsecp256k1_HAS_SECP256K1_SCHNORRSIG_VERIFY))
|
| 126 |
+
include(CheckSymbolExists)
|
| 127 |
+
include(CMakePushCheckState)
|
| 128 |
+
cmake_push_check_state(RESET)
|
| 129 |
+
string(APPEND CMAKE_REQUIRED_FLAGS " ${libsecp256k1_CFLAGS_OTHER}")
|
| 130 |
+
list(APPEND CMAKE_REQUIRED_INCLUDES ${libsecp256k1_INCLUDE_DIRS})
|
| 131 |
+
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS ${libsecp256k1_LDFLAGS})
|
| 132 |
+
list(APPEND CMAKE_REQUIRED_LIBRARIES ${libsecp256k1_LIBRARIES})
|
| 133 |
+
unset(missing_modules)
|
| 134 |
+
macro(check_secp256k1_module module symbol)
|
| 135 |
+
string(TOUPPER "${symbol}" VAR)
|
| 136 |
+
set(VAR "libsecp256k1_HAS_${VAR}")
|
| 137 |
+
unset(${VAR})
|
| 138 |
+
check_symbol_exists("${symbol}" "secp256k1_${module}.h" ${VAR})
|
| 139 |
+
if(NOT ${VAR})
|
| 140 |
+
list(APPEND missing_modules "${module}")
|
| 141 |
+
endif()
|
| 142 |
+
endmacro()
|
| 143 |
+
message(CHECK_START "Checking for required libsecp256k1 modules")
|
| 144 |
+
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
| 145 |
+
check_secp256k1_module(ellswift secp256k1_ellswift_create)
|
| 146 |
+
check_secp256k1_module(extrakeys secp256k1_xonly_pubkey_parse)
|
| 147 |
+
check_secp256k1_module(recovery secp256k1_ecdsa_recover)
|
| 148 |
+
check_secp256k1_module(schnorrsig secp256k1_schnorrsig_verify)
|
| 149 |
+
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
| 150 |
+
if(missing_modules)
|
| 151 |
+
list(JOIN missing_modules ", " missing_modules)
|
| 152 |
+
message(FATAL_ERROR "System-installed libsecp256k1 lacks these required modules: ${missing_modules}.")
|
| 153 |
+
endif()
|
| 154 |
+
message(CHECK_PASS "all were found")
|
| 155 |
+
cmake_pop_check_state()
|
| 156 |
+
endif()
|
| 157 |
+
endif() # WITH_SYSTEM_LIBSECP256K1
|
| 158 |
+
|
| 159 |
option(ENABLE_WALLET "Enable wallet." ON)
|
| 160 |
option(WITH_SQLITE "Enable SQLite wallet support." ${ENABLE_WALLET})
|
| 161 |
if(WITH_SQLITE)
|
|
|
|
| 181 |
"BDB (legacy) wallets opened by this build will not be portable!"
|
| 182 |
)
|
| 183 |
if(WARN_INCOMPATIBLE_BDB)
|
| 184 |
+
message(FATAL_ERROR "If this is intended, pass \"-DWARN_INCOMPATIBLE_BDB=OFF\".\n"
|
| 185 |
"Passing \"-DWITH_BDB=OFF\" will suppress this warning."
|
| 186 |
)
|
| 187 |
endif()
|
|
|
|
| 194 |
option(WERROR "Treat compiler warnings as errors." OFF)
|
| 195 |
option(WITH_CCACHE "Attempt to use ccache for compiling." ON)
|
| 196 |
|
| 197 |
+
option(WITH_MINIUPNPC "Enable UPnP." OFF)
|
| 198 |
+
if(WITH_MINIUPNPC)
|
| 199 |
+
find_package(MiniUPnPc MODULE REQUIRED)
|
| 200 |
+
endif()
|
| 201 |
+
|
| 202 |
option(WITH_ZMQ "Enable ZMQ notifications." OFF)
|
| 203 |
if(WITH_ZMQ)
|
| 204 |
find_package(ZeroMQ 4.0.0 MODULE REQUIRED)
|
|
|
|
| 209 |
find_package(USDT MODULE REQUIRED)
|
| 210 |
endif()
|
| 211 |
|
| 212 |
+
option(ENABLE_EXTERNAL_SIGNER "Enable external signer support." ON)
|
| 213 |
+
|
| 214 |
+
option(ENABLE_TOR_SUBPROCESS "Enable support for executing a dedicated Tor node." ON)
|
| 215 |
|
| 216 |
cmake_dependent_option(WITH_QRENCODE "Enable QR code support." ON "BUILD_GUI" OFF)
|
| 217 |
if(WITH_QRENCODE)
|
|
|
|
| 221 |
|
| 222 |
cmake_dependent_option(WITH_DBUS "Enable DBus support." ON "NOT CMAKE_SYSTEM_NAME MATCHES \"(Windows|Darwin)\" AND BUILD_GUI" OFF)
|
| 223 |
|
| 224 |
+
cmake_dependent_option(WITH_TASKBAR_PROGRESS "Enable GUI taskbar progress." ON "CMAKE_SYSTEM_NAME STREQUAL \"Windows\" AND BUILD_GUI" OFF)
|
| 225 |
+
|
| 226 |
+
set(WITH_MULTIPROCESS OFF)
|
| 227 |
if(WITH_MULTIPROCESS)
|
| 228 |
find_package(Libmultiprocess REQUIRED COMPONENTS Lib)
|
| 229 |
find_package(LibmultiprocessNative REQUIRED COMPONENTS Bin
|
|
|
|
| 241 |
list(APPEND qt_components DBus)
|
| 242 |
set(USE_DBUS TRUE)
|
| 243 |
endif()
|
| 244 |
+
if(WITH_TASKBAR_PROGRESS)
|
| 245 |
+
set(BITCOIN_QT_WIN_TASKBAR TRUE)
|
| 246 |
+
endif()
|
| 247 |
if(BUILD_GUI_TESTS)
|
| 248 |
list(APPEND qt_components Test)
|
| 249 |
endif()
|
| 250 |
+
if("${WITH_QT_VERSION}" STREQUAL "6")
|
| 251 |
+
find_package(Qt 6.2 MODULE REQUIRED
|
| 252 |
+
COMPONENTS ${qt_components}
|
| 253 |
+
)
|
| 254 |
+
else() # ! Qt 6
|
| 255 |
find_package(Qt 5.11.3 MODULE REQUIRED
|
| 256 |
COMPONENTS ${qt_components}
|
| 257 |
)
|
| 258 |
+
endif() # Qt 6
|
| 259 |
unset(qt_components)
|
| 260 |
endif()
|
| 261 |
|
|
|
|
| 302 |
set(BUILD_WALLET_TOOL OFF)
|
| 303 |
set(BUILD_GUI OFF)
|
| 304 |
set(ENABLE_EXTERNAL_SIGNER OFF)
|
| 305 |
+
set(WITH_MINIUPNPC OFF)
|
| 306 |
set(WITH_ZMQ OFF)
|
| 307 |
set(BUILD_TESTS OFF)
|
| 308 |
set(BUILD_GUI_TESTS OFF)
|
|
|
|
| 314 |
)
|
| 315 |
endif()
|
| 316 |
|
| 317 |
+
# The external_lib_interface interface library aims to encapsulate build flags, which
|
| 318 |
+
# are specific to non-internal libraries.
|
| 319 |
+
# It is intended to be a usage requirement for non-internal library
|
| 320 |
+
# targets.
|
| 321 |
+
add_library(external_lib_interface INTERFACE)
|
| 322 |
+
|
| 323 |
include(TryAppendCXXFlags)
|
| 324 |
include(TryAppendLinkerFlag)
|
| 325 |
|
| 326 |
+
# Sanitizers require leaving undefined symbols in the library
|
| 327 |
+
if(NOT SANITIZERS)
|
| 328 |
+
try_append_linker_flag("-Wl,--no-undefined" TARGET external_lib_interface)
|
| 329 |
+
endif()
|
| 330 |
+
|
| 331 |
# Redefine/adjust per-configuration flags.
|
| 332 |
target_compile_definitions(core_interface_debug INTERFACE
|
| 333 |
DEBUG
|
|
|
|
| 399 |
# As a best effort, target Windows 8.
|
| 400 |
try_append_linker_flag("-Wl,--major-subsystem-version,6" TARGET core_interface)
|
| 401 |
try_append_linker_flag("-Wl,--minor-subsystem-version,2" TARGET core_interface)
|
| 402 |
+
|
| 403 |
+
find_library(MINGWTHRD_LIBRARY mingwthrd)
|
| 404 |
+
if (MINGWTHRD_LIBRARY)
|
| 405 |
+
target_link_libraries(core_interface INTERFACE
|
| 406 |
+
${MINGWTHRD_LIBRARY}
|
| 407 |
+
)
|
| 408 |
+
endif()
|
| 409 |
endif()
|
| 410 |
|
| 411 |
# Workaround producing large object files, which cannot be handled by the assembler.
|
|
|
|
| 501 |
find_package(Libevent 2.1.8 MODULE REQUIRED)
|
| 502 |
endif()
|
| 503 |
|
| 504 |
+
include(cmake/iopriority.cmake)
|
| 505 |
+
|
| 506 |
include(cmake/introspection.cmake)
|
| 507 |
|
| 508 |
+
include(cmake/mempressure.cmake)
|
| 509 |
+
|
| 510 |
include(cmake/ccache.cmake)
|
| 511 |
|
| 512 |
add_library(warn_interface INTERFACE)
|
|
|
|
| 543 |
try_append_cxx_flags("-Woverloaded-virtual" TARGET warn_interface SKIP_LINK)
|
| 544 |
try_append_cxx_flags("-Wsuggest-override" TARGET warn_interface SKIP_LINK)
|
| 545 |
try_append_cxx_flags("-Wimplicit-fallthrough" TARGET warn_interface SKIP_LINK)
|
| 546 |
+
try_append_cxx_flags("-Wunreachable-code-loop-increment" TARGET warn_interface SKIP_LINK)
|
| 547 |
try_append_cxx_flags("-Wdocumentation" TARGET warn_interface SKIP_LINK)
|
| 548 |
try_append_cxx_flags("-Wself-assign" TARGET warn_interface SKIP_LINK)
|
| 549 |
try_append_cxx_flags("-Wbidi-chars=any" TARGET warn_interface SKIP_LINK)
|
|
|
|
| 662 |
unset(werror_flag)
|
| 663 |
endif()
|
| 664 |
|
| 665 |
+
|
| 666 |
# Prefer Unix-style package components over frameworks on macOS.
|
| 667 |
# This improves compatibility with Python version managers.
|
| 668 |
set(Python3_FIND_FRAMEWORK LAST CACHE STRING "")
|
|
|
|
| 670 |
# improves compatibility with Python version managers that use shims.
|
| 671 |
set(Python3_FIND_UNVERSIONED_NAMES FIRST CACHE STRING "")
|
| 672 |
mark_as_advanced(Python3_FIND_FRAMEWORK Python3_FIND_UNVERSIONED_NAMES)
|
| 673 |
+
if(BUILD_GUI)
|
| 674 |
+
find_package(Python3 3.10 REQUIRED COMPONENTS Interpreter)
|
| 675 |
+
else()
|
| 676 |
find_package(Python3 3.10 COMPONENTS Interpreter)
|
| 677 |
+
endif()
|
| 678 |
if(Python3_EXECUTABLE)
|
| 679 |
set(PYTHON_COMMAND ${Python3_EXECUTABLE})
|
| 680 |
else()
|
|
|
|
| 683 |
)
|
| 684 |
endif()
|
| 685 |
|
| 686 |
+
if(BUILD_GUI)
|
| 687 |
+
find_program(RSVG_CONVERT rsvg-convert REQUIRED)
|
| 688 |
+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
| 689 |
+
find_program(IMAGEMAGICK_CONVERT NAMES magick convert)
|
| 690 |
+
find_program(PNG2ICNS png2icns REQUIRED)
|
| 691 |
+
else()
|
| 692 |
+
find_program(IMAGEMAGICK_CONVERT NAMES magick convert REQUIRED)
|
| 693 |
+
find_program(PNG2ICNS png2icns)
|
| 694 |
+
endif()
|
| 695 |
+
endif()
|
| 696 |
+
|
| 697 |
target_compile_definitions(core_interface INTERFACE ${DEPENDS_COMPILE_DEFINITIONS})
|
| 698 |
target_compile_definitions(core_interface_relwithdebinfo INTERFACE ${DEPENDS_COMPILE_DEFINITIONS_RELWITHDEBINFO})
|
| 699 |
target_compile_definitions(core_interface_debug INTERFACE ${DEPENDS_COMPILE_DEFINITIONS_DEBUG})
|
|
|
|
| 726 |
if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
| 727 |
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
| 728 |
else()
|
|
|
|
| 729 |
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
|
| 730 |
endif()
|
| 731 |
add_subdirectory(test)
|
|
|
|
| 751 |
else()
|
| 752 |
set(bitcoin_daemon_status OFF)
|
| 753 |
endif()
|
| 754 |
+
if(BUILD_GUI)
|
| 755 |
+
if("${WITH_QT_VERSION}" STREQUAL "6")
|
| 756 |
+
set(bitcoin_qt_status "ON (Qt 6)")
|
| 757 |
+
else()
|
| 758 |
+
set(bitcoin_qt_status "ON (Qt 5)")
|
| 759 |
+
endif()
|
| 760 |
+
else()
|
| 761 |
+
set(bitcoin_qt_status "OFF")
|
| 762 |
+
endif()
|
| 763 |
+
message(" bitcoin-qt (GUI) .................... ${bitcoin_qt_status}")
|
| 764 |
if(BUILD_GUI AND WITH_MULTIPROCESS)
|
| 765 |
set(bitcoin_gui_status ON)
|
| 766 |
else()
|
| 767 |
set(bitcoin_gui_status OFF)
|
| 768 |
endif()
|
|
|
|
| 769 |
message(" bitcoin-cli ......................... ${BUILD_CLI}")
|
| 770 |
message(" bitcoin-tx .......................... ${BUILD_TX}")
|
| 771 |
message(" bitcoin-util ........................ ${BUILD_UTIL}")
|
|
|
|
| 779 |
message(" - legacy wallets (Berkeley DB) ..... ${WITH_BDB}")
|
| 780 |
endif()
|
| 781 |
message(" external signer ..................... ${ENABLE_EXTERNAL_SIGNER}")
|
| 782 |
+
message(" tor subprocess ...................... ${ENABLE_TOR_SUBPROCESS}")
|
| 783 |
+
message(" port mapping using UPnP ............. ${WITH_MINIUPNPC}")
|
| 784 |
message(" ZeroMQ .............................. ${WITH_ZMQ}")
|
| 785 |
message(" USDT tracing ........................ ${WITH_USDT}")
|
| 786 |
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
|