cmake: Do not modify build types when integrating by downstream project

The `CMAKE_BUILD_TYPE` and `CMAKE_CONFIGURATION_TYPES` variables must be
managed by the downstream project.

Suggesting to review with `git diff -w`.
This commit is contained in:
Hennadii Stepanov
2024-06-18 15:44:15 +01:00
parent 35c0fdc86b
commit 158f9e5eae

View File

@@ -213,6 +213,7 @@ mark_as_advanced(
CMAKE_SHARED_LINKER_FLAGS_COVERAGE CMAKE_SHARED_LINKER_FLAGS_COVERAGE
) )
if(PROJECT_IS_TOP_LEVEL)
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
set(default_build_type "RelWithDebInfo") set(default_build_type "RelWithDebInfo")
if(is_multi_config) if(is_multi_config)
@@ -232,6 +233,7 @@ else()
) )
endif() endif()
endif() endif()
endif()
include(TryAppendCFlags) include(TryAppendCFlags)
if(MSVC) if(MSVC)