mirror of
https://github.com/reactos/CMake.git
synced 2024-11-25 12:40:06 +00:00
Do not initialize CMAKE_BUILD_TYPE on multi-config generators
Use the `GENERATOR_IS_MULTI_CONFIG` global property to reliably detect multi-config generators regardless of what variables the project or user have set.
This commit is contained in:
parent
333ff168eb
commit
8187b88471
@ -75,11 +75,13 @@ set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE
|
||||
"Flags used by the assembler during all build types.")
|
||||
|
||||
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
get_property(_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
# default build type is none
|
||||
if(NOT CMAKE_NO_BUILD_TYPE)
|
||||
if(NOT _GENERATOR_IS_MULTI_CONFIG AND NOT CMAKE_NO_BUILD_TYPE)
|
||||
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
||||
"Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
|
||||
endif()
|
||||
unset(_GENERATOR_IS_MULTI_CONFIG)
|
||||
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
|
||||
"Flags used by the assembler during debug builds.")
|
||||
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
||||
|
@ -110,11 +110,13 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during all build types.")
|
||||
|
||||
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
get_property(_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
# default build type is none
|
||||
if(NOT CMAKE_NO_BUILD_TYPE)
|
||||
if(NOT _GENERATOR_IS_MULTI_CONFIG AND NOT CMAKE_NO_BUILD_TYPE)
|
||||
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
||||
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||
endif()
|
||||
unset(_GENERATOR_IS_MULTI_CONFIG)
|
||||
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during debug builds.")
|
||||
set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
||||
|
@ -17,11 +17,13 @@ foreach(t EXE SHARED MODULE STATIC)
|
||||
endforeach()
|
||||
|
||||
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||
get_property(_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
# default build type is none
|
||||
if(NOT CMAKE_NO_BUILD_TYPE)
|
||||
if(NOT _GENERATOR_IS_MULTI_CONFIG AND NOT CMAKE_NO_BUILD_TYPE)
|
||||
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
||||
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||
endif()
|
||||
unset(_GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
|
||||
"Flags used by the linker during debug builds.")
|
||||
|
Loading…
Reference in New Issue
Block a user