mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 12:23:34 -05:00
build: set build type and per-build-type flags as early as possible
With the exception of the first c++ checks, this ensures that compiler tests are never run with the wrong build type's flags. Co-Authored-By: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
This commit is contained in:
parent
f605f7a9c2
commit
56a9b847bb
2 changed files with 3 additions and 4 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,8 +231,6 @@ if(BUILD_FOR_FUZZING)
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(ProcessConfigurations)
|
|
||||||
|
|
||||||
include(TryAppendCXXFlags)
|
include(TryAppendCXXFlags)
|
||||||
include(TryAppendLinkerFlag)
|
include(TryAppendLinkerFlag)
|
||||||
|
|
||||||
|
|
|
@ -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,6 +117,8 @@ endfunction()
|
||||||
|
|
||||||
set_default_config(RelWithDebInfo)
|
set_default_config(RelWithDebInfo)
|
||||||
|
|
||||||
|
include(TryAppendCXXFlags)
|
||||||
|
|
||||||
# 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