summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-07 14:26:29 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-02-07 14:26:37 (GMT)
commit4e44cbc67330249bd7d04c5a1bc74516e44226a7 (patch)
tree52df264dac5bc8af9e8e47119fb8a30bfe40ed44
parentb3fd1bcfa5278e75ad7a0404bd084ab68f3f5bb4 (diff)
parent1844be451e2c27129fbdff9aed121c1b6395c1d0 (diff)
downloadCMake-4e44cbc67330249bd7d04c5a1bc74516e44226a7.zip
CMake-4e44cbc67330249bd7d04c5a1bc74516e44226a7.tar.gz
CMake-4e44cbc67330249bd7d04c5a1bc74516e44226a7.tar.bz2
Merge topic 'ninja-multi-default-config-fix'
1844be451e Ninja Multi-Config: Fix issue with CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4331
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/DefaultBuildFileConfig.cmake1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake4
3 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 78ab2a8..ff9c433 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -2658,6 +2658,7 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
defaultConfigsString = this->DefaultFileConfig;
}
if (!defaultConfigsString.empty() &&
+ defaultConfigsString != this->DefaultFileConfig &&
(this->DefaultFileConfig.empty() || this->CrossConfigs.empty())) {
std::ostringstream msg;
msg << "CMAKE_NMC_DEFAULT_CONFIGS cannot be used without "
diff --git a/Tests/RunCMake/NinjaMultiConfig/DefaultBuildFileConfig.cmake b/Tests/RunCMake/NinjaMultiConfig/DefaultBuildFileConfig.cmake
new file mode 100644
index 0000000..bb7b160
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/DefaultBuildFileConfig.cmake
@@ -0,0 +1 @@
+# Intentionally empty
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index 8f0913b..827e560 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -154,6 +154,10 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=Release;-DCMAKE
run_cmake(InvalidDefaultConfigsNoCross)
unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG=Release")
+run_cmake(DefaultBuildFileConfig)
+unset(RunCMake_TEST_OPTIONS)
+
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SimpleNoCross-build)
run_cmake_configure(SimpleNoCross)
include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)