mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:35:47 +00:00
[CMAKE] Rely less on CMAKE_BUILD_TYPE variable
Having conditional statements with CMAKE_BUILD_TYPE is an antipattern See https://stackoverflow.com/questions/66079007/having-conditional-statements-on-build-type-variable-a-good-design We use both single- and multi-config generators (Ninja and VS), so we can't really rely on CMAKE_BUILD_TYPE, because it's not always set. This commit alters some conditional flags to use <$CONFIG:...> generator expression, but is still not complete. Also, our default optimization level (4) now has what was always a de-facto flags
This commit is contained in:
parent
f0b53998c8
commit
d10728a645
4 changed files with 17 additions and 26 deletions
|
@ -1,10 +1,4 @@
|
|||
|
||||
# Default to Debug for the build type
|
||||
if(NOT DEFINED CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
|
||||
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||
endif()
|
||||
|
||||
# pass variables necessary for the toolchain (needed for try_compile)
|
||||
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES ARCH USE_CLANG_CL)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue