diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-02-05 18:32:04 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-02-06 16:07:38 (GMT) |
commit | 9e219de4fb50096a9386dbe6de9f98cf8a7ec199 (patch) | |
tree | 0ea9983da347a69958da346acb242b888bc36acd /Tests | |
parent | 13ef3285df97fa97a4cc1b7fe81741aeb8adcf7a (diff) | |
download | CMake-9e219de4fb50096a9386dbe6de9f98cf8a7ec199.zip CMake-9e219de4fb50096a9386dbe6de9f98cf8a7ec199.tar.gz CMake-9e219de4fb50096a9386dbe6de9f98cf8a7ec199.tar.bz2 |
Ninja Multi-Config: Don't include MinSizeRel by default
Diffstat (limited to 'Tests')
-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 |
6 files changed, 29 insertions, 8 deletions
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) |