diff options
author | Brad King <brad.king@kitware.com> | 2020-02-12 14:15:37 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-02-12 14:15:54 (GMT) |
commit | 645474dba1a9a4d5ed29eb0fabbedc9a9008dc5e (patch) | |
tree | 4155217bf28cfac4a0f635d22d862d10471b922e /Source | |
parent | 10b834a3eb77debb44365c7cbdd4db6e8216a4e5 (diff) | |
parent | 46c836644d2566e2a568318e5676eaa08f65501e (diff) | |
download | CMake-645474dba1a9a4d5ed29eb0fabbedc9a9008dc5e.zip CMake-645474dba1a9a4d5ed29eb0fabbedc9a9008dc5e.tar.gz CMake-645474dba1a9a4d5ed29eb0fabbedc9a9008dc5e.tar.bz2 |
Merge topic 'ninja-multi-default-configs-fix' into release-3.17
46c836644d Ninja Multi-Config: Fix issue with "all" in CMAKE_NMC_DEFAULT_CONFIGS
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4349
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 12 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 2 |
2 files changed, 8 insertions, 6 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 " diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index a59859e..3db8356 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -427,7 +427,7 @@ protected: const std::string& name); static cm::optional<std::set<std::string>> ListSubsetWithAll( - const std::set<std::string>& defaults, + const std::set<std::string>& all, const std::set<std::string>& defaults, const std::vector<std::string>& items); virtual bool InspectConfigTypeVariables() { return true; } |