فهرست منبع

Merge topic 'ninja-multi-no-minsizerel'

9e219de4fb Ninja Multi-Config: Don't include MinSizeRel by default

Acked-by: Kitware Robot <[email protected]>
Acked-by: Ben Boeckel <[email protected]>
Merge-request: !4326
Brad King 5 سال پیش
والد
کامیت
6c142ac7aa

+ 1 - 1
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",

+ 3 - 3
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)

+ 8 - 0
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

+ 2 - 0
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")

+ 8 - 1
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()

+ 4 - 0
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)

+ 4 - 4
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)