diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-11-11 16:44:47 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2022-11-11 17:29:41 (GMT) |
commit | 09d7f947d68796e8fde923a47636f1c764b5a7af (patch) | |
tree | 86f7cc8f0731ae27d1b372711169ecf00f5f9870 /Source | |
parent | 553794e98706800a8c792bbcd81d49522333a50f (diff) | |
download | CMake-09d7f947d68796e8fde923a47636f1c764b5a7af.zip CMake-09d7f947d68796e8fde923a47636f1c764b5a7af.tar.gz CMake-09d7f947d68796e8fde923a47636f1c764b5a7af.tar.bz2 |
cmGeneratorExpression: Require cmake instance
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmExportInstallFileGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmExportTryCompileFileGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmFileCommand.cxx | 6 | ||||
-rw-r--r-- | Source/cmFileSet.cxx | 9 | ||||
-rw-r--r-- | Source/cmFileSet.h | 4 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 15 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.h | 13 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluationFile.cxx | 2 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 2 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 59 | ||||
-rw-r--r-- | Source/cmInstalledFile.cxx | 4 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 2 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 5 | ||||
-rw-r--r-- | Source/cmTestGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 10 |
19 files changed, 92 insertions, 59 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 41d4442..57b009a 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -172,7 +172,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator( }; } - cmGeneratorExpression ge(cc.GetBacktrace()); + cmGeneratorExpression ge(*lg->GetCMakeInstance(), cc.GetBacktrace()); cmGeneratorTarget const* target{ lg->FindGeneratorTargetToUse( this->Target) }; @@ -417,7 +417,8 @@ std::string cmCustomCommandGenerator::GetDepfile() const return ""; } - cmGeneratorExpression ge(this->CC->GetBacktrace()); + cmGeneratorExpression ge(*this->LG->GetCMakeInstance(), + this->CC->GetBacktrace()); return EvaluateDepfile(depfile, ge, this->LG, this->OutputConfig); } diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 2c61163..bd2b6af 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -379,7 +379,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( const char* propName = "INTERFACE_INCLUDE_DIRECTORIES"; cmValue input = target->GetProperty(propName); - cmGeneratorExpression ge; + cmGeneratorExpression ge(*target->Makefile->GetCMakeInstance()); std::string dirs = cmGeneratorExpression::Preprocess( cmJoin(target->Target->GetInstallIncludeDirectoriesEntries(te), ";"), diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 195737b..5e190f4 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -570,7 +570,7 @@ std::string cmExportInstallFileGenerator::GetFileSetDirectories( auto configs = gte->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); - cmGeneratorExpression ge; + cmGeneratorExpression ge(*gte->Makefile->GetCMakeInstance()); auto cge = ge.Parse(te->FileSetGenerators.at(fileSet)->GetDestination()); for (auto const& config : configs) { @@ -617,7 +617,7 @@ std::string cmExportInstallFileGenerator::GetFileSetFiles( auto fileEntries = fileSet->CompileFileEntries(); auto directoryEntries = fileSet->CompileDirectoryEntries(); - cmGeneratorExpression destGe; + cmGeneratorExpression destGe(*gte->Makefile->GetCMakeInstance()); auto destCge = destGe.Parse(te->FileSetGenerators.at(fileSet)->GetDestination()); diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index e98aa05..33c057d 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -70,7 +70,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets( return std::string(); } - cmGeneratorExpression ge; + cmGeneratorExpression ge(*tgt->Makefile->GetCMakeInstance()); std::unique_ptr<cmGeneratorExpressionDAGChecker> parentDagChecker; if (propName == "INTERFACE_LINK_OPTIONS") { diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index cc9b256..b1d238c 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2462,11 +2462,13 @@ void AddEvaluationFile(const std::string& inputName, { cmListFileBacktrace lfbt = status.GetMakefile().GetBacktrace(); - cmGeneratorExpression outputGe(lfbt); + cmGeneratorExpression outputGe(*status.GetMakefile().GetCMakeInstance(), + lfbt); std::unique_ptr<cmCompiledGeneratorExpression> outputCge = outputGe.Parse(outputExpr); - cmGeneratorExpression conditionGe(lfbt); + cmGeneratorExpression conditionGe(*status.GetMakefile().GetCMakeInstance(), + lfbt); std::unique_ptr<cmCompiledGeneratorExpression> conditionCge = conditionGe.Parse(condition); diff --git a/Source/cmFileSet.cxx b/Source/cmFileSet.cxx index d6665a2..b96ba6e 100644 --- a/Source/cmFileSet.cxx +++ b/Source/cmFileSet.cxx @@ -78,9 +78,10 @@ bool cmFileSetVisibilityIsForInterface(cmFileSetVisibility vis) return false; } -cmFileSet::cmFileSet(std::string name, std::string type, +cmFileSet::cmFileSet(cmake& cmakeInstance, std::string name, std::string type, cmFileSetVisibility visibility) - : Name(std::move(name)) + : CMakeInstance(cmakeInstance) + , Name(std::move(name)) , Type(std::move(type)) , Visibility(visibility) { @@ -113,7 +114,7 @@ cmFileSet::CompileFileEntries() const for (auto const& entry : this->FileEntries) { for (auto const& ex : cmExpandedList(entry.Value)) { - cmGeneratorExpression ge(entry.Backtrace); + cmGeneratorExpression ge(this->CMakeInstance, entry.Backtrace); auto cge = ge.Parse(ex); result.push_back(std::move(cge)); } @@ -129,7 +130,7 @@ cmFileSet::CompileDirectoryEntries() const for (auto const& entry : this->DirectoryEntries) { for (auto const& ex : cmExpandedList(entry.Value)) { - cmGeneratorExpression ge(entry.Backtrace); + cmGeneratorExpression ge(this->CMakeInstance, entry.Backtrace); auto cge = ge.Parse(ex); result.push_back(std::move(cge)); } diff --git a/Source/cmFileSet.h b/Source/cmFileSet.h index 5357e77..54d430c 100644 --- a/Source/cmFileSet.h +++ b/Source/cmFileSet.h @@ -17,6 +17,7 @@ struct cmGeneratorExpressionDAGChecker; class cmGeneratorTarget; class cmLocalGenerator; class cmMakefile; +class cmake; enum class cmFileSetVisibility { @@ -33,7 +34,7 @@ bool cmFileSetVisibilityIsForInterface(cmFileSetVisibility vis); class cmFileSet { public: - cmFileSet(std::string name, std::string type, + cmFileSet(cmake& cmakeInstance, std::string name, std::string type, cmFileSetVisibility visibility); const std::string& GetName() const { return this->Name; } @@ -77,6 +78,7 @@ public: static bool IsValidName(const std::string& name); private: + cmake& CMakeInstance; std::string Name; std::string Type; cmFileSetVisibility Visibility; diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index f988e54..8f0db47 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -13,11 +13,14 @@ #include "cmGeneratorExpressionEvaluator.h" #include "cmGeneratorExpressionLexer.h" #include "cmGeneratorExpressionParser.h" +#include "cmLocalGenerator.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" -cmGeneratorExpression::cmGeneratorExpression(cmListFileBacktrace backtrace) - : Backtrace(std::move(backtrace)) +cmGeneratorExpression::cmGeneratorExpression(cmake& cmakeInstance, + cmListFileBacktrace backtrace) + : CMakeInstance(cmakeInstance) + , Backtrace(std::move(backtrace)) { } @@ -29,7 +32,8 @@ std::unique_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse( std::string input) const { return std::unique_ptr<cmCompiledGeneratorExpression>( - new cmCompiledGeneratorExpression(this->Backtrace, std::move(input))); + new cmCompiledGeneratorExpression(this->CMakeInstance, this->Backtrace, + std::move(input))); } std::string cmGeneratorExpression::Evaluate( @@ -39,7 +43,8 @@ std::string cmGeneratorExpression::Evaluate( cmGeneratorTarget const* currentTarget, std::string const& language) { if (Find(input) != std::string::npos) { - cmCompiledGeneratorExpression cge(cmListFileBacktrace(), std::move(input)); + cmCompiledGeneratorExpression cge(*lg->GetCMakeInstance(), + cmListFileBacktrace(), std::move(input)); return cge.Evaluate(lg, config, headTarget, dagChecker, currentTarget, language); } @@ -97,7 +102,7 @@ const std::string& cmCompiledGeneratorExpression::EvaluateWithContext( } cmCompiledGeneratorExpression::cmCompiledGeneratorExpression( - cmListFileBacktrace backtrace, std::string input) + cmake& /*cmakeInstance*/, cmListFileBacktrace backtrace, std::string input) : Backtrace(std::move(backtrace)) , Input(std::move(input)) { diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 188993f..e22b8ab 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -12,10 +12,11 @@ #include <vector> #include "cmListFileCache.h" +#include "cmLocalGenerator.h" +class cmake; class cmCompiledGeneratorExpression; class cmGeneratorTarget; -class cmLocalGenerator; struct cmGeneratorExpressionContext; struct cmGeneratorExpressionDAGChecker; struct cmGeneratorExpressionEvaluator; @@ -33,7 +34,8 @@ class cmGeneratorExpression { public: /** Construct. */ - cmGeneratorExpression(cmListFileBacktrace backtrace = cmListFileBacktrace()); + cmGeneratorExpression(cmake& cmakeInstance, + cmListFileBacktrace backtrace = cmListFileBacktrace()); ~cmGeneratorExpression(); cmGeneratorExpression(cmGeneratorExpression const&) = delete; @@ -82,6 +84,7 @@ public: const std::string& replacement); private: + cmake& CMakeInstance; cmListFileBacktrace Backtrace; }; @@ -152,7 +155,8 @@ private: cmGeneratorExpressionContext& context, cmGeneratorExpressionDAGChecker* dagChecker) const; - cmCompiledGeneratorExpression(cmListFileBacktrace backtrace, + cmCompiledGeneratorExpression(cmake& cmakeInstance, + cmListFileBacktrace backtrace, std::string input); friend class cmGeneratorExpression; @@ -184,7 +188,8 @@ public: std::string config, cmGeneratorTarget const* headTarget, std::string language = std::string()) - : LocalGenerator(localGenerator) + : GeneratorExpression(*localGenerator->GetCMakeInstance()) + , LocalGenerator(localGenerator) , Config(std::move(config)) , HeadTarget(headTarget) , Language(std::move(language)) diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index 8f3ed4d..817437e 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -165,7 +165,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg) } cmListFileBacktrace lfbt = this->OutputFileExpr->GetBacktrace(); - cmGeneratorExpression contentGE(lfbt); + cmGeneratorExpression contentGE(*lg->GetCMakeInstance(), lfbt); std::unique_ptr<cmCompiledGeneratorExpression> inputExpression = contentGE.Parse(inputContent); diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 45d5a83..562c31e 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -57,7 +57,7 @@ std::string cmGeneratorExpressionNode::EvaluateDependentExpression( cmGeneratorExpressionDAGChecker* dagChecker, cmGeneratorTarget const* currentTarget) { - cmGeneratorExpression ge(context->Backtrace); + cmGeneratorExpression ge(*lg->GetCMakeInstance(), context->Backtrace); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop); cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem); cge->SetQuiet(context->Quiet); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index becf244..6065285 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -241,15 +241,16 @@ private: std::unique_ptr< cmGeneratorTarget:: - TargetPropertyEntry> static CreateTargetPropertyEntry(const BT<std:: - string>& + TargetPropertyEntry> static CreateTargetPropertyEntry(cmake& cmakeInstance, + const BT< + std::string>& propertyValue, bool evaluateForBuildsystem = false) { if (cmGeneratorExpression::Find(propertyValue.Value) != std::string::npos) { - cmGeneratorExpression ge(propertyValue.Backtrace); + cmGeneratorExpression ge(cmakeInstance, propertyValue.Backtrace); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(propertyValue.Value); cge->SetEvaluateForBuildsystem(evaluateForBuildsystem); @@ -262,12 +263,13 @@ std::unique_ptr< } static void CreatePropertyGeneratorExpressions( - cmBTStringRange entries, + cmake& cmakeInstance, cmBTStringRange entries, std::vector<std::unique_ptr<cmGeneratorTarget::TargetPropertyEntry>>& items, bool evaluateForBuildsystem = false) { for (auto const& entry : entries) { - items.push_back(CreateTargetPropertyEntry(entry, evaluateForBuildsystem)); + items.push_back( + CreateTargetPropertyEntry(cmakeInstance, entry, evaluateForBuildsystem)); } } @@ -343,29 +345,36 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) this->GlobalGenerator->ComputeTargetObjectDirectory(this); - CreatePropertyGeneratorExpressions(t->GetIncludeDirectoriesEntries(), + CreatePropertyGeneratorExpressions(*lg->GetCMakeInstance(), + t->GetIncludeDirectoriesEntries(), this->IncludeDirectoriesEntries); - CreatePropertyGeneratorExpressions(t->GetCompileOptionsEntries(), + CreatePropertyGeneratorExpressions(*lg->GetCMakeInstance(), + t->GetCompileOptionsEntries(), this->CompileOptionsEntries); - CreatePropertyGeneratorExpressions(t->GetCompileFeaturesEntries(), + CreatePropertyGeneratorExpressions(*lg->GetCMakeInstance(), + t->GetCompileFeaturesEntries(), this->CompileFeaturesEntries); - CreatePropertyGeneratorExpressions(t->GetCompileDefinitionsEntries(), + CreatePropertyGeneratorExpressions(*lg->GetCMakeInstance(), + t->GetCompileDefinitionsEntries(), this->CompileDefinitionsEntries); - CreatePropertyGeneratorExpressions(t->GetLinkOptionsEntries(), + CreatePropertyGeneratorExpressions(*lg->GetCMakeInstance(), + t->GetLinkOptionsEntries(), this->LinkOptionsEntries); - CreatePropertyGeneratorExpressions(t->GetLinkDirectoriesEntries(), + CreatePropertyGeneratorExpressions(*lg->GetCMakeInstance(), + t->GetLinkDirectoriesEntries(), this->LinkDirectoriesEntries); - CreatePropertyGeneratorExpressions(t->GetPrecompileHeadersEntries(), + CreatePropertyGeneratorExpressions(*lg->GetCMakeInstance(), + t->GetPrecompileHeadersEntries(), this->PrecompileHeadersEntries); - CreatePropertyGeneratorExpressions(t->GetSourceEntries(), - this->SourceEntries, true); + CreatePropertyGeneratorExpressions( + *lg->GetCMakeInstance(), t->GetSourceEntries(), this->SourceEntries, true); this->PolicyMap = t->GetPolicyMap(); @@ -753,6 +762,7 @@ void cmGeneratorTarget::AddSourceCommon(const std::string& src, bool before) this->SourceEntries.insert( before ? this->SourceEntries.begin() : this->SourceEntries.end(), CreateTargetPropertyEntry( + *this->LocalGenerator->GetCMakeInstance(), BT<std::string>(src, this->Makefile->GetBacktrace()), true)); this->ClearSourcesCache(); } @@ -780,6 +790,7 @@ void cmGeneratorTarget::AddIncludeDirectory(const std::string& src, before ? this->IncludeDirectoriesEntries.begin() : this->IncludeDirectoriesEntries.end(), CreateTargetPropertyEntry( + *this->Makefile->GetCMakeInstance(), BT<std::string>(src, this->Makefile->GetBacktrace()), true)); } @@ -1653,7 +1664,8 @@ void AddObjectEntries(cmGeneratorTarget const* headTarget, headTarget->GetGlobalGenerator()->IndexGeneratorTargetUniquely( lib.Target); std::string genex = "$<TARGET_OBJECTS:" + std::move(uniqueName) + ">"; - cmGeneratorExpression ge(lib.Backtrace); + cmGeneratorExpression ge(*headTarget->Makefile->GetCMakeInstance(), + lib.Backtrace); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex); cge->SetEvaluateForBuildsystem(true); @@ -4192,7 +4204,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetCompileDefinitions( } case cmPolicies::OLD: { std::unique_ptr<TargetPropertyEntry> entry = - CreateTargetPropertyEntry(*configProp); + CreateTargetPropertyEntry( + *this->LocalGenerator->GetCMakeInstance(), *configProp); entries.Entries.emplace_back(EvaluateTargetPropertyEntry( this, config, language, &dagChecker, *entry)); } break; @@ -4778,8 +4791,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetStaticLibraryLinkOptions( if (cmValue linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) { std::vector<std::string> options = cmExpandedList(*linkOptions); for (const auto& option : options) { - std::unique_ptr<TargetPropertyEntry> entry = - CreateTargetPropertyEntry(option); + std::unique_ptr<TargetPropertyEntry> entry = CreateTargetPropertyEntry( + *this->LocalGenerator->GetCMakeInstance(), option); entries.Entries.emplace_back(EvaluateTargetPropertyEntry( this, config, language, &dagChecker, *entry)); } @@ -4931,8 +4944,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDepends( if (cmValue linkDepends = this->GetProperty("LINK_DEPENDS")) { std::vector<std::string> depends = cmExpandedList(*linkDepends); for (const auto& depend : depends) { - std::unique_ptr<TargetPropertyEntry> entry = - CreateTargetPropertyEntry(depend); + std::unique_ptr<TargetPropertyEntry> entry = CreateTargetPropertyEntry( + *this->LocalGenerator->GetCMakeInstance(), depend); entries.Entries.emplace_back(EvaluateTargetPropertyEntry( this, config, language, &dagChecker, *entry)); } @@ -6756,7 +6769,8 @@ void cmGeneratorTarget::ExpandLinkItems( cmMakefile const* mf = this->LocalGenerator->GetMakefile(); LookupLinkItemScope scope{ this->LocalGenerator }; for (BT<std::string> const& entry : entries) { - cmGeneratorExpression ge(entry.Backtrace); + cmGeneratorExpression ge(*this->LocalGenerator->GetCMakeInstance(), + entry.Backtrace); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(entry.Value); cge->SetEvaluateForBuildsystem(true); std::vector<std::string> libs = cmExpandedList( @@ -8195,7 +8209,8 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries( break; } } - cmGeneratorExpression ge(entry.Backtrace); + cmGeneratorExpression ge(*this->LocalGenerator->GetCMakeInstance(), + entry.Backtrace); std::unique_ptr<cmCompiledGeneratorExpression> const cge = ge.Parse(entry.Value); cge->SetEvaluateForBuildsystem(true); diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx index 0974eea..5bf8320 100644 --- a/Source/cmInstalledFile.cxx +++ b/Source/cmInstalledFile.cxx @@ -21,7 +21,7 @@ cmInstalledFile::Property::~Property() = default; void cmInstalledFile::SetName(cmMakefile* mf, const std::string& name) { cmListFileBacktrace backtrace = mf->GetBacktrace(); - cmGeneratorExpression ge(backtrace); + cmGeneratorExpression ge(*mf->GetCMakeInstance(), backtrace); this->Name = name; this->NameExpression = ge.Parse(name); @@ -56,7 +56,7 @@ void cmInstalledFile::AppendProperty(cmMakefile const* mf, bool /*asString*/) { cmListFileBacktrace backtrace = mf->GetBacktrace(); - cmGeneratorExpression ge(backtrace); + cmGeneratorExpression ge(*mf->GetCMakeInstance(), backtrace); Property& property = this->Properties[prop]; property.ValueExpressions.push_back(ge.Parse(value)); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index fb269b2..31c6504 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -4503,7 +4503,7 @@ std::vector<std::string> cmLocalGenerator::ExpandCustomCommandOutputGenex( std::string const& o, cmListFileBacktrace const& bt) { std::vector<std::string> allConfigOutputs; - cmGeneratorExpression ge(bt); + cmGeneratorExpression ge(*this->GetCMakeInstance(), bt); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(o); std::vector<std::string> configs = this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index c11f5b4..1e2ea2a 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -701,7 +701,7 @@ bool cmLocalNinjaGenerator::HasUniqueByproducts( { std::vector<std::string> configs = this->GetMakefile()->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); - cmGeneratorExpression ge(bt); + cmGeneratorExpression ge(*this->GetCMakeInstance(), bt); for (std::string const& p : byproducts) { if (cmGeneratorExpression::Find(p) == std::string::npos) { return false; diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 96649ab..6f78a46 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -2095,7 +2095,7 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& genVars, // Evaluate generator expression { cmListFileBacktrace lfbt = this->Makefile->GetBacktrace(); - cmGeneratorExpression ge(lfbt); + cmGeneratorExpression ge(*this->Makefile->GetCMakeInstance(), lfbt); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(val); genVars.Executable = cge->Evaluate(this->LocalGen, ""); } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 874195b..2955d7c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2656,8 +2656,9 @@ cmFileSet* cmTarget::GetFileSet(const std::string& name) std::pair<cmFileSet*, bool> cmTarget::GetOrCreateFileSet( const std::string& name, const std::string& type, cmFileSetVisibility vis) { - auto result = this->impl->FileSets.emplace( - std::make_pair(name, cmFileSet(name, type, vis))); + auto result = this->impl->FileSets.emplace(std::make_pair( + name, + cmFileSet(*this->GetMakefile()->GetCMakeInstance(), name, type, vis))); if (result.second) { auto bt = this->impl->Makefile->GetBacktrace(); if (type == this->impl->HeadersFileSets.TypeName) { diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index dbb0876..5e325dd 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -127,7 +127,8 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, this->TestGenerated = true; // Set up generator expression evaluation context. - cmGeneratorExpression ge(this->Test->GetBacktrace()); + cmGeneratorExpression ge(*this->Test->GetMakefile()->GetCMakeInstance(), + this->Test->GetBacktrace()); // Determine if policy CMP0110 is set to NEW. const bool quote_test_name = diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 9393389..7e43bee 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2090,7 +2090,7 @@ void cmVisualStudio10TargetGenerator::ParseSettingsProperty( const std::string& settingsPropertyValue, ConfigToSettings& toolSettings) { if (!settingsPropertyValue.empty()) { - cmGeneratorExpression ge; + cmGeneratorExpression ge(*this->LocalGenerator->GetCMakeInstance()); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(settingsPropertyValue); @@ -2190,7 +2190,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( } // Figure out if there's any additional flags to use if (cmValue saf = sf->GetProperty("VS_SHADER_FLAGS")) { - cmGeneratorExpression ge; + cmGeneratorExpression ge(*this->LocalGenerator->GetCMakeInstance()); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*saf); for (const std::string& config : this->Configurations) { @@ -2203,7 +2203,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( } // Figure out if debug information should be generated if (cmValue sed = sf->GetProperty("VS_SHADER_ENABLE_DEBUG")) { - cmGeneratorExpression ge; + cmGeneratorExpression ge(*this->LocalGenerator->GetCMakeInstance()); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*sed); for (const std::string& config : this->Configurations) { @@ -2217,7 +2217,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( } // Figure out if optimizations should be disabled if (cmValue sdo = sf->GetProperty("VS_SHADER_DISABLE_OPTIMIZATIONS")) { - cmGeneratorExpression ge; + cmGeneratorExpression ge(*this->LocalGenerator->GetCMakeInstance()); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*sdo); for (const std::string& config : this->Configurations) { @@ -2331,7 +2331,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource( this->FinishWritingSource(e2, toolSettings); if (!deployContent.empty()) { - cmGeneratorExpression ge; + cmGeneratorExpression ge(*this->LocalGenerator->GetCMakeInstance()); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(deployContent); // Deployment location cannot be set on a configuration basis |