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:36 (GMT)
commit135378fd187d5d246b200197dab917c81e6c0351 (patch)
tree46a5d2cf070491b013847896bca515dc6a3ec70d
parent92faf1aeb4f07a02783ef73b54f0920a02a47d15 (diff)
parent1844be451e2c27129fbdff9aed121c1b6395c1d0 (diff)
downloadCMake-135378fd187d5d246b200197dab917c81e6c0351.zip
CMake-135378fd187d5d246b200197dab917c81e6c0351.tar.gz
CMake-135378fd187d5d246b200197dab917c81e6c0351.tar.bz2
Merge topic 'ninja-multi-default-config-fix' into release-3.17
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 b3d536f..55efff2 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -2657,6 +2657,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)