diff options
author | Brad King <brad.king@kitware.com> | 2020-02-07 14:17:18 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-02-07 14:17:26 (GMT) |
commit | 6c142ac7aaeb50b06f0372a4e75c70ca8af37554 (patch) | |
tree | 2dd2074f8cbe4bbd4dadc563e5e8dec48db76ce6 | |
parent | 737ca8e016aaed9d7fe7b9aeb2933131dced92b1 (diff) | |
parent | 9e219de4fb50096a9386dbe6de9f98cf8a7ec199 (diff) | |
download | CMake-6c142ac7aaeb50b06f0372a4e75c70ca8af37554.zip CMake-6c142ac7aaeb50b06f0372a4e75c70ca8af37554.tar.gz CMake-6c142ac7aaeb50b06f0372a4e75c70ca8af37554.tar.bz2 |
Merge topic 'ninja-multi-no-minsizerel'
9e219de4fb Ninja Multi-Config: Don't include MinSizeRel by default
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !4326
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 2 | ||||
-rw-r--r-- | Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/CMakeOnly/Test.cmake.in | 8 | ||||
-rw-r--r-- | Tests/CTestConfig/dashboard.cmake.in | 2 | ||||
-rw-r--r-- | Tests/CTestConfig/script.cmake.in | 9 | ||||
-rw-r--r-- | Tests/RunCMake/FileAPI/RunCMakeTest.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake | 8 |
7 files changed, 30 insertions, 9 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index aaad201..78ab2a8 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -736,7 +736,7 @@ void cmGlobalNinjaGenerator::EnableLanguage( if (this->IsMultiConfig()) { if (!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) { mf->AddCacheDefinition( - "CMAKE_CONFIGURATION_TYPES", "Debug;Release;MinSizeRel;RelWithDebInfo", + "CMAKE_CONFIGURATION_TYPES", "Debug;Release;RelWithDebInfo", "Semicolon separated list of supported configuration types, only " "supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything " "else will be ignored", diff --git a/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt b/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt index a584505..859ec41 100644 --- a/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}") include(CheckStructHasMember) -foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) +foreach(_config_type Release RelWithDebInfo Debug) set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type}) unset(CSHM_RESULT_S1_${_config_type} CACHE) unset(CSHM_RESULT_S2_${_config_type} CACHE) @@ -26,7 +26,7 @@ foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) endif() endforeach() -foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) +foreach(_config_type Release RelWithDebInfo Debug) set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type}) unset(CSHM_RESULT_S1_${_config_type}_C CACHE) unset(CSHM_RESULT_S2_${_config_type}_C CACHE) @@ -46,7 +46,7 @@ foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) endif() endforeach() -foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) +foreach(_config_type Release RelWithDebInfo Debug) set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type}) unset(CSHM_RESULT_S1_${_config_type}_CXX CACHE) unset(CSHM_RESULT_S2_${_config_type}_CXX CACHE) diff --git a/Tests/CMakeOnly/Test.cmake.in b/Tests/CMakeOnly/Test.cmake.in index 0ae8af1..c531e8b 100644 --- a/Tests/CMakeOnly/Test.cmake.in +++ b/Tests/CMakeOnly/Test.cmake.in @@ -7,6 +7,13 @@ if(make_program) set(maybe_make_program "-DCMAKE_MAKE_PROGRAM=${make_program}") endif() +set(_isMultiConfig "@_isMultiConfig@") +if(_isMultiConfig) + set(cfg_opts "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;RelWithDebInfo") +else() + set(cfg_opts) +endif() + set(source_dir "@CMAKE_CURRENT_SOURCE_DIR@/${TEST_SOURCE}") set(binary_dir "@CMAKE_CURRENT_BINARY_DIR@/${TEST}-build") file(REMOVE_RECURSE "${binary_dir}") @@ -16,6 +23,7 @@ execute_process( "${source_dir}" -G "@CMAKE_GENERATOR@" -A "@CMAKE_GENERATOR_PLATFORM@" -T "@CMAKE_GENERATOR_TOOLSET@" + ${cfg_opts} ${maybe_make_program} WORKING_DIRECTORY "${binary_dir}" RESULT_VARIABLE result diff --git a/Tests/CTestConfig/dashboard.cmake.in b/Tests/CTestConfig/dashboard.cmake.in index 4bb1262..34824e3 100644 --- a/Tests/CTestConfig/dashboard.cmake.in +++ b/Tests/CTestConfig/dashboard.cmake.in @@ -13,6 +13,8 @@ message("CMAKE_CTEST_COMMAND='${CMAKE_CTEST_COMMAND}'") set(arg "") if(NOT _isMultiConfig) set(arg "-DCMAKE_BUILD_TYPE:STRING=@cfg@") +else() + set(arg "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;MinSizeRel\\;RelWithDebInfo") endif() message("cmake initial configure") diff --git a/Tests/CTestConfig/script.cmake.in b/Tests/CTestConfig/script.cmake.in index 973c7b8..59c585b 100644 --- a/Tests/CTestConfig/script.cmake.in +++ b/Tests/CTestConfig/script.cmake.in @@ -6,7 +6,14 @@ set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestConfig/@cfg@-script") ctest_start(Experimental) -ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE rv) +set(_isMultiConfig "@_isMultiConfig@") +if(_isMultiConfig) + set(cfg_opts "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;MinSizeRel\\;RelWithDebInfo") +else() + set(cfg_opts) +endif() + +ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS "${cfg_opts}" RETURN_VALUE rv) if(NOT rv STREQUAL 0) message(FATAL_ERROR "*** error in ctest_configure ***") endif() diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake index f8adb64..8cdc00c 100644 --- a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake +++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake @@ -34,6 +34,10 @@ function(check_python case) endif() endfunction() +if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;MinSizeRel\\;RelWithDebInfo") +endif() + run_cmake(Nothing) run_cmake(Empty) run_cmake(EmptyClient) diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake index 2344158..8f0913b 100644 --- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake @@ -81,7 +81,7 @@ endfunction() set(RunCMake_TEST_NO_CLEAN 1) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Simple-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=RelWithDebInfo;-DCMAKE_NMC_CROSS_CONFIGS=all") +set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;MinSizeRel\\;RelWithDebInfo;-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=RelWithDebInfo;-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(Simple) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) @@ -113,7 +113,7 @@ run_ninja(Simple default-build-file-clean-minsizerel build.ninja clean:MinSizeRe run_ninja(Simple default-build-file-all build.ninja all) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SimpleDefaultBuildAlias-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=Release;-DCMAKE_NMC_DEFAULT_CONFIGS=all;-DCMAKE_NMC_CROSS_CONFIGS=all") +set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;MinSizeRel\\;RelWithDebInfo;-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=Release;-DCMAKE_NMC_DEFAULT_CONFIGS=all;-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(SimpleDefaultBuildAlias) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) @@ -188,7 +188,7 @@ include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) run_cmake_build(Framework framework Debug all) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CustomCommandGenerator-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=all") +set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;MinSizeRel\\;RelWithDebInfo;-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(CustomCommandGenerator) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) @@ -236,7 +236,7 @@ run_ninja(Clean release-notall build-Release.ninja exenotall) run_cmake_build(Clean release-clean Release clean) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AdditionalCleanFiles-build) -set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=all") +set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;MinSizeRel\\;RelWithDebInfo;-DCMAKE_NMC_CROSS_CONFIGS=all") run_cmake_configure(AdditionalCleanFiles) unset(RunCMake_TEST_OPTIONS) run_cmake_build(AdditionalCleanFiles release-clean Release clean) |