mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 12:23:34 -05:00
Merge bitcoin/bitcoin#31711: build: set build type and per-build-type flags as early as possible
56a9b847bb
build: set build type and per-build-type flags as early as possible (Cory Fields)f605f7a9c2
build: refactor: set debug definitions in main CMakeLists (Cory Fields) Pull request description: This ensures that most compiler tests are not run with the wrong build type's flags. The initial c++ checks are an exception to that because many internal CMake variables are unset until a language is selected, so it's problematic to change our build type before that. The difference can be seen in `build/CMakeFiles/CMakeConfigureLog.yaml`. Before, `Debug` was used for many of the earlly checks. After this PR, it's only the first 2 checks. ACKs for top commit: hebasto: ACK56a9b847bb
. Tree-SHA512: 87947352d6d4fd08554515822cb13634ed3be33fcda2af817c22ef943b1d0856ceb39311ddc01b8221397528fdc09f630dc7e74fc92f5a4a073f09c4ae493596
This commit is contained in:
commit
0b6ed342b5
2 changed files with 12 additions and 12 deletions
|
@ -70,6 +70,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module)
|
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module)
|
||||||
|
include(ProcessConfigurations)
|
||||||
|
|
||||||
#=============================
|
#=============================
|
||||||
# Configurable options
|
# Configurable options
|
||||||
|
@ -230,11 +231,18 @@ if(BUILD_FOR_FUZZING)
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(ProcessConfigurations)
|
|
||||||
|
|
||||||
include(TryAppendCXXFlags)
|
include(TryAppendCXXFlags)
|
||||||
include(TryAppendLinkerFlag)
|
include(TryAppendLinkerFlag)
|
||||||
|
|
||||||
|
# Redefine/adjust per-configuration flags.
|
||||||
|
target_compile_definitions(core_interface_debug INTERFACE
|
||||||
|
DEBUG
|
||||||
|
DEBUG_LOCKORDER
|
||||||
|
DEBUG_LOCKCONTENTION
|
||||||
|
RPC_DOC_CHECK
|
||||||
|
ABORT_ON_FAILED_ASSUME
|
||||||
|
)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
#[=[
|
#[=[
|
||||||
This build system supports two ways to build binaries for Windows.
|
This build system supports two ways to build binaries for Windows.
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
include_guard(GLOBAL)
|
include_guard(GLOBAL)
|
||||||
|
|
||||||
include(TryAppendCXXFlags)
|
|
||||||
|
|
||||||
macro(normalize_string string)
|
macro(normalize_string string)
|
||||||
string(REGEX REPLACE " +" " " ${string} "${${string}}")
|
string(REGEX REPLACE " +" " " ${string} "${${string}}")
|
||||||
string(STRIP "${${string}}" ${string})
|
string(STRIP "${${string}}" ${string})
|
||||||
|
@ -119,14 +117,8 @@ endfunction()
|
||||||
|
|
||||||
set_default_config(RelWithDebInfo)
|
set_default_config(RelWithDebInfo)
|
||||||
|
|
||||||
# Redefine/adjust per-configuration flags.
|
include(TryAppendCXXFlags)
|
||||||
target_compile_definitions(core_interface_debug INTERFACE
|
|
||||||
DEBUG
|
|
||||||
DEBUG_LOCKORDER
|
|
||||||
DEBUG_LOCKCONTENTION
|
|
||||||
RPC_DOC_CHECK
|
|
||||||
ABORT_ON_FAILED_ASSUME
|
|
||||||
)
|
|
||||||
# We leave assertions on.
|
# We leave assertions on.
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
remove_cxx_flag_from_all_configs(/DNDEBUG)
|
remove_cxx_flag_from_all_configs(/DNDEBUG)
|
||||||
|
|
Loading…
Add table
Reference in a new issue