summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeASMInformation.cmake
diff options
context:
space:
mode:
authorBastien Schatt <bastien.schatt@magestik.fr>2017-04-04 20:11:28 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-06 13:44:34 (GMT)
commit8187b884717db85a4c413f8a32f72dceff8f9b8a (patch)
tree06c1439fa88bb9bf133df32881422bebeb84cbfa /Modules/CMakeASMInformation.cmake
parent333ff168eb04e12d5d118a2e9cf50d600c508db5 (diff)
downloadCMake-8187b884717db85a4c413f8a32f72dceff8f9b8a.zip
CMake-8187b884717db85a4c413f8a32f72dceff8f9b8a.tar.gz
CMake-8187b884717db85a4c413f8a32f72dceff8f9b8a.tar.bz2
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.
Diffstat (limited to 'Modules/CMakeASMInformation.cmake')
-rw-r--r--Modules/CMakeASMInformation.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index 01355ff..f7cf900 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -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)
-# default build type is none
- if(NOT CMAKE_NO_BUILD_TYPE)
+ get_property(_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ # default build type is none
+ 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