diff --git a/CMakeLists.txt b/CMakeLists.txt index f53a458d348..c84e011088a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module) +include(ProcessConfigurations) #============================= # Configurable options @@ -230,11 +231,18 @@ if(BUILD_FOR_FUZZING) ) endif() -include(ProcessConfigurations) - include(TryAppendCXXFlags) 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) #[=[ This build system supports two ways to build binaries for Windows. diff --git a/cmake/module/ProcessConfigurations.cmake b/cmake/module/ProcessConfigurations.cmake index 7e2fc0080e9..9a510a00a55 100644 --- a/cmake/module/ProcessConfigurations.cmake +++ b/cmake/module/ProcessConfigurations.cmake @@ -4,8 +4,6 @@ include_guard(GLOBAL) -include(TryAppendCXXFlags) - macro(normalize_string string) string(REGEX REPLACE " +" " " ${string} "${${string}}") string(STRIP "${${string}}" ${string}) @@ -119,14 +117,8 @@ endfunction() set_default_config(RelWithDebInfo) -# Redefine/adjust per-configuration flags. -target_compile_definitions(core_interface_debug INTERFACE - DEBUG - DEBUG_LOCKORDER - DEBUG_LOCKCONTENTION - RPC_DOC_CHECK - ABORT_ON_FAILED_ASSUME -) +include(TryAppendCXXFlags) + # We leave assertions on. if(MSVC) remove_cxx_flag_from_all_configs(/DNDEBUG)