Skip to content

Commit 56a9b84

Browse files
theunihebasto
andcommitted
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 <[email protected]>
1 parent f605f7a commit 56a9b84

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
7070
set(CMAKE_CXX_EXTENSIONS OFF)
7171

7272
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module)
73+
include(ProcessConfigurations)
7374

7475
#=============================
7576
# Configurable options
@@ -230,8 +231,6 @@ if(BUILD_FOR_FUZZING)
230231
)
231232
endif()
232233

233-
include(ProcessConfigurations)
234-
235234
include(TryAppendCXXFlags)
236235
include(TryAppendLinkerFlag)
237236

cmake/module/ProcessConfigurations.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
include_guard(GLOBAL)
66

7-
include(TryAppendCXXFlags)
8-
97
macro(normalize_string string)
108
string(REGEX REPLACE " +" " " ${string} "${${string}}")
119
string(STRIP "${${string}}" ${string})
@@ -119,6 +117,8 @@ endfunction()
119117

120118
set_default_config(RelWithDebInfo)
121119

120+
include(TryAppendCXXFlags)
121+
122122
# We leave assertions on.
123123
if(MSVC)
124124
remove_cxx_flag_from_all_configs(/DNDEBUG)

0 commit comments

Comments
 (0)