summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-14 15:48:31 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-10-14 15:49:16 (GMT)
commit609f2a14063c2bd7be416ac363257e616dce6ff2 (patch)
tree7cb3ed87d489a97b4ca2311276efd7b102509ce9
parent150a1c7b17540c3c5512249a66c01585c74d6db0 (diff)
parent297ab15bf6cbc75f30c83238977b4b83524e7107 (diff)
downloadCMake-609f2a14063c2bd7be416ac363257e616dce6ff2.zip
CMake-609f2a14063c2bd7be416ac363257e616dce6ff2.tar.gz
CMake-609f2a14063c2bd7be416ac363257e616dce6ff2.tar.bz2
Merge topic 'ninja-multi-no-cache-variables'
297ab15bf6 Ninja Multi-Config: Read configuration variables as normal variables Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5360
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx33
-rw-r--r--Source/cmGlobalNinjaGenerator.h3
2 files changed, 13 insertions, 23 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 985f430..9e25a54 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -2650,30 +2650,17 @@ void cmGlobalNinjaMultiGenerator::GetQtAutoGenConfigs(
bool cmGlobalNinjaMultiGenerator::InspectConfigTypeVariables()
{
- this->GetCMakeInstance()->MarkCliAsUsed("CMAKE_DEFAULT_BUILD_TYPE");
- this->GetCMakeInstance()->MarkCliAsUsed("CMAKE_CROSS_CONFIGS");
- this->GetCMakeInstance()->MarkCliAsUsed("CMAKE_DEFAULT_CONFIGS");
- return this->ReadCacheEntriesForBuild(*this->Makefiles.front()->GetState());
-}
-
-std::string cmGlobalNinjaMultiGenerator::GetDefaultBuildConfig() const
-{
- return "";
-}
-
-bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
- const cmState& state)
-{
std::vector<std::string> configsVec;
- cmExpandList(state.GetSafeCacheEntryValue("CMAKE_CONFIGURATION_TYPES"),
- configsVec);
+ cmExpandList(
+ this->Makefiles.front()->GetSafeDefinition("CMAKE_CONFIGURATION_TYPES"),
+ configsVec);
if (configsVec.empty()) {
configsVec.emplace_back();
}
std::set<std::string> configs(configsVec.cbegin(), configsVec.cend());
this->DefaultFileConfig =
- state.GetSafeCacheEntryValue("CMAKE_DEFAULT_BUILD_TYPE");
+ this->Makefiles.front()->GetSafeDefinition("CMAKE_DEFAULT_BUILD_TYPE");
if (this->DefaultFileConfig.empty()) {
this->DefaultFileConfig = configsVec.front();
}
@@ -2688,8 +2675,9 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
}
std::vector<std::string> crossConfigsVec;
- cmExpandList(state.GetSafeCacheEntryValue("CMAKE_CROSS_CONFIGS"),
- crossConfigsVec);
+ cmExpandList(
+ this->Makefiles.front()->GetSafeDefinition("CMAKE_CROSS_CONFIGS"),
+ crossConfigsVec);
auto crossConfigs = ListSubsetWithAll(configs, configs, crossConfigsVec);
if (!crossConfigs) {
std::ostringstream msg;
@@ -2702,7 +2690,7 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
this->CrossConfigs = *crossConfigs;
auto defaultConfigsString =
- state.GetSafeCacheEntryValue("CMAKE_DEFAULT_CONFIGS");
+ this->Makefiles.front()->GetSafeDefinition("CMAKE_DEFAULT_CONFIGS");
if (defaultConfigsString.empty()) {
defaultConfigsString = this->DefaultFileConfig;
}
@@ -2736,6 +2724,11 @@ bool cmGlobalNinjaMultiGenerator::ReadCacheEntriesForBuild(
return true;
}
+std::string cmGlobalNinjaMultiGenerator::GetDefaultBuildConfig() const
+{
+ return "";
+}
+
std::string cmGlobalNinjaMultiGenerator::OrderDependsTargetForTarget(
cmGeneratorTarget const* target, const std::string& config) const
{
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 884a711..f6e7633 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -31,7 +31,6 @@ class cmLinkLineComputer;
class cmLocalGenerator;
class cmMakefile;
class cmOutputConverter;
-class cmState;
class cmStateDirectory;
class cmake;
struct cmDocumentationEntry;
@@ -647,8 +646,6 @@ public:
std::string GetDefaultBuildConfig() const override;
- bool ReadCacheEntriesForBuild(const cmState& state) override;
-
bool SupportsDefaultBuildType() const override { return true; }
bool SupportsCrossConfigs() const override { return true; }
bool SupportsDefaultConfigs() const override { return true; }