summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-02-11 15:49:54 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-02-11 15:49:54 (GMT)
commit46c836644d2566e2a568318e5676eaa08f65501e (patch)
tree1d9793be36aa666cda329558d8ea629c84753f83 /Source/cmGlobalNinjaGenerator.cxx
parent0db0b721564a584ff1783ac2cf14db6fd867d6b2 (diff)
downloadCMake-46c836644d2566e2a568318e5676eaa08f65501e.zip
CMake-46c836644d2566e2a568318e5676eaa08f65501e.tar.gz
CMake-46c836644d2566e2a568318e5676eaa08f65501e.tar.bz2
Ninja Multi-Config: Fix issue with "all" in CMAKE_NMC_DEFAULT_CONFIGS
Prior to this fix, CMAKE_NMC_DEFAULT_CONFIGS would inherit "all" from the union of CMAKE_NMC_DEFAULT_BUILD_FILE_CONFIG and CMAKE_NMC_CROSS_CONFIGS. This is inconsistent with the behavior of the "all" target signifying CMAKE_NMC_CROSS_CONFIGS. Update "all" in CMAKE_NMC_DEFAULT_CONFIGS to inherit only from CMAKE_NMC_CROSS_CONFIGS.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 55efff2..35421b6 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -890,7 +890,8 @@ bool cmGlobalNinjaGenerator::OpenFileStream(
}
cm::optional<std::set<std::string>> cmGlobalNinjaGenerator::ListSubsetWithAll(
- const std::set<std::string>& defaults, const std::vector<std::string>& items)
+ const std::set<std::string>& all, const std::set<std::string>& defaults,
+ const std::vector<std::string>& items)
{
std::set<std::string> result;
@@ -901,7 +902,7 @@ cm::optional<std::set<std::string>> cmGlobalNinjaGenerator::ListSubsetWithAll(
} else {
return cm::nullopt;
}
- } else if (defaults.count(item)) {
+ } else if (all.count(item)) {
result.insert(item);
} else {
return cm::nullopt;
@@ -2640,7 +2641,7 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
std::vector<std::string> crossConfigsVec;
cmExpandList(state.GetSafeCacheEntryValue("CMAKE_NMC_CROSS_CONFIGS"),
crossConfigsVec);
- auto crossConfigs = ListSubsetWithAll(configs, crossConfigsVec);
+ auto crossConfigs = ListSubsetWithAll(configs, configs, crossConfigsVec);
if (!crossConfigs) {
std::ostringstream msg;
msg << "CMAKE_NMC_CROSS_CONFIGS is not a subset of "
@@ -2671,8 +2672,9 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
std::vector<std::string> defaultConfigsVec;
cmExpandList(defaultConfigsString, defaultConfigsVec);
if (!this->DefaultFileConfig.empty()) {
- auto defaultConfigs = ListSubsetWithAll(
- this->GetCrossConfigs(this->DefaultFileConfig), defaultConfigsVec);
+ auto defaultConfigs =
+ ListSubsetWithAll(this->GetCrossConfigs(this->DefaultFileConfig),
+ this->CrossConfigs, defaultConfigsVec);
if (!defaultConfigs) {
std::ostringstream msg;
msg << "CMAKE_NMC_DEFAULT_CONFIGS is not a subset of "