mirror of
https://github.com/reactos/reactos
synced 2025-10-06 00:12:51 +02: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:
@@ -49,6 +49,16 @@ else()
|
||||
set(WINARCH ${ARCH})
|
||||
endif()
|
||||
|
||||
# set CMAKE_BUILD_TYPE if not set
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "Setting build type to Debug as none was specified.")
|
||||
set(CMAKE_BUILD_TYPE "Debug" CACHE
|
||||
STRING "Choose the type of build." FORCE)
|
||||
# Set the possible values of build type for cmake-gui
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
endif()
|
||||
|
||||
# Versioning
|
||||
include(sdk/include/reactos/version.cmake)
|
||||
|
||||
|
Reference in New Issue
Block a user