diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 616975019e..3da4657ef6 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -523,10 +523,9 @@ std::string cmCommonTargetGenerator::GetLinkerLauncher( cmValue launcherProp = this->GeneratorTarget->GetProperty(propName); if (cmNonempty(launcherProp)) { cm::GenEx::Context context(this->LocalCommonGenerator, config, lang); - cmGeneratorExpressionDAGChecker dagChecker{ - this->GeneratorTarget, propName, nullptr, nullptr, context.LG, - context.Config - }; + cmGeneratorExpressionDAGChecker dagChecker{ this->GeneratorTarget, + propName, nullptr, nullptr, + context }; std::string evaluatedLinklauncher = cmGeneratorExpression::Evaluate( *launcherProp, context.LG, context.Config, this->GeneratorTarget, &dagChecker, this->GeneratorTarget, context.Language); diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index adb4be5aa3..a7a64326ab 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -630,13 +630,8 @@ cmComputeLinkDepends::cmComputeLinkDepends(cmGeneratorTarget const* target, if (!feature->empty() && key.length() > lloPrefix.length()) { auto item = key.substr(lloPrefix.length()); cmGeneratorExpressionDAGChecker dagChecker{ - this->Target, - "LINK_LIBRARY_OVERRIDE", - nullptr, - nullptr, - context.LG, - context.Config, - this->Target->GetBacktrace(), + this->Target, "LINK_LIBRARY_OVERRIDE", nullptr, nullptr, + context, this->Target->GetBacktrace(), }; auto overrideFeature = cmGeneratorExpression::Evaluate( *feature, context.LG, context.Config, this->Target, &dagChecker, @@ -650,13 +645,8 @@ cmComputeLinkDepends::cmComputeLinkDepends(cmGeneratorTarget const* target, if (cmValue linkLibraryOverride = this->Target->GetProperty("LINK_LIBRARY_OVERRIDE")) { cmGeneratorExpressionDAGChecker dagChecker{ - this->Target, - "LINK_LIBRARY_OVERRIDE", - nullptr, - nullptr, - context.LG, - context.Config, - this->Target->GetBacktrace(), + this->Target, "LINK_LIBRARY_OVERRIDE", nullptr, nullptr, + context, this->Target->GetBacktrace(), }; auto overrideValue = cmGeneratorExpression::Evaluate( *linkLibraryOverride, context.LG, context.Config, this->Target, diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index ac9cfbbdc4..e90295b20f 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -86,10 +86,10 @@ std::string cmExportTryCompileFileGenerator::FindTargets( // To please constraint checks of DAGChecker, this property must have // LINK_OPTIONS property as parent parentDagChecker = cm::make_unique( - tgt, "LINK_OPTIONS", nullptr, nullptr, context.LG, context.Config); + tgt, "LINK_OPTIONS", nullptr, nullptr, context); } cmGeneratorExpressionDAGChecker dagChecker{ - tgt, propName, nullptr, parentDagChecker.get(), context.LG, context.Config, + tgt, propName, nullptr, parentDagChecker.get(), context, }; std::unique_ptr cge = ge.Parse(*prop); diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index cba6049bdb..62c14397dc 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -463,8 +463,7 @@ std::string const& cmGeneratorExpressionInterpreter::Evaluate( property == "COMPILE_FLAGS" ? "COMPILE_OPTIONS" : property, nullptr, nullptr, - context.LG, - context.Config, + context, }; return this->CompiledGeneratorExpression->Evaluate( diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index 0a548dcadf..c7e71f7c78 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -21,9 +21,8 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker( cmGeneratorTarget const* target, std::string property, GeneratorExpressionContent const* content, - cmGeneratorExpressionDAGChecker* parent, cmLocalGenerator const* contextLG, - std::string const& contextConfig, cmListFileBacktrace backtrace, - ComputingLinkLibraries computingLinkLibraries) + cmGeneratorExpressionDAGChecker* parent, cm::GenEx::Context const& context, + cmListFileBacktrace backtrace, ComputingLinkLibraries computingLinkLibraries) : Parent(parent) , Top(parent ? parent->Top : this) , Target(target) @@ -37,7 +36,8 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker( } else { this->TopIsTransitiveProperty = this->Target - ->IsTransitiveProperty(this->Property, contextLG, contextConfig, this) + ->IsTransitiveProperty(this->Property, context.LG, context.Config, + this) .has_value(); } diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h index 03492c5edf..c310c8e6b3 100644 --- a/Source/cmGeneratorExpressionDAGChecker.h +++ b/Source/cmGeneratorExpressionDAGChecker.h @@ -12,13 +12,13 @@ namespace cm { namespace GenEx { +struct Context; struct Evaluation; } } struct GeneratorExpressionContent; class cmGeneratorTarget; -class cmLocalGenerator; struct cmGeneratorExpressionDAGChecker { @@ -30,8 +30,7 @@ struct cmGeneratorExpressionDAGChecker cmGeneratorExpressionDAGChecker( cmGeneratorTarget const* target, std::string property, GeneratorExpressionContent const* content, - cmGeneratorExpressionDAGChecker* parent, cmLocalGenerator const* contextLG, - std::string const& contextConfig, + cmGeneratorExpressionDAGChecker* parent, cm::GenEx::Context const& context, cmListFileBacktrace backtrace = cmListFileBacktrace(), ComputingLinkLibraries computingLinkLibraries = ComputingLinkLibraries::No); diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index a085eb44f6..d5f59840a4 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -481,8 +481,7 @@ protected: cmGeneratorExpressionDAGChecker dagChecker{ eval->HeadTarget, genexOperator + ":" + expression, content, dagCheckerParent, - eval->Context.LG, eval->Context.Config, - eval->Backtrace, + eval->Context, eval->Backtrace, }; switch (dagChecker.Check()) { case cmGeneratorExpressionDAGChecker::SELF_REFERENCE: @@ -2926,9 +2925,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode } cmGeneratorExpressionDAGChecker dagChecker{ - target, propertyName, content, - dagCheckerParent, eval->Context.LG, eval->Context.Config, - eval->Backtrace, + target, propertyName, content, + dagCheckerParent, eval->Context, eval->Backtrace, }; switch (dagChecker.Check()) { diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 276af84778..c57abc398c 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -740,7 +740,7 @@ std::string cmGeneratorTarget::GetLinkerTypeProperty( if (!linkerType.IsEmpty()) { cm::GenEx::Context context(this->LocalGenerator, config, lang); cmGeneratorExpressionDAGChecker dagChecker{ - this, propName, nullptr, nullptr, context.LG, context.Config, + this, propName, nullptr, nullptr, context, }; auto ltype = cmGeneratorExpression::Evaluate( *linkerType, context.LG, context.Config, this, &dagChecker, this, @@ -1203,8 +1203,7 @@ void cmGeneratorTarget::AddSystemIncludeCacheKey( { cm::GenEx::Context context(this->LocalGenerator, config, language); cmGeneratorExpressionDAGChecker dagChecker{ - this, "SYSTEM_INCLUDE_DIRECTORIES", nullptr, nullptr, context.LG, - context.Config, + this, "SYSTEM_INCLUDE_DIRECTORIES", nullptr, nullptr, context, }; bool excludeImported = this->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED"); @@ -1981,7 +1980,7 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector& result, cm::GenEx::Context context(this->LocalGenerator, config); cmGeneratorExpressionDAGChecker dagChecker{ - this, "AUTOUIC_OPTIONS", nullptr, nullptr, context.LG, context.Config, + this, "AUTOUIC_OPTIONS", nullptr, nullptr, context, }; cmExpandList(cmGeneratorExpression::Evaluate( prop, context.LG, context.Config, this, &dagChecker), diff --git a/Source/cmGeneratorTarget_IncludeDirectories.cxx b/Source/cmGeneratorTarget_IncludeDirectories.cxx index 1e1bd15734..8c8382c4ee 100644 --- a/Source/cmGeneratorTarget_IncludeDirectories.cxx +++ b/Source/cmGeneratorTarget_IncludeDirectories.cxx @@ -49,13 +49,8 @@ std::string AddLangSpecificInterfaceIncludeDirectories( { cm::GenEx::Context context(target->LocalGenerator, config); cmGeneratorExpressionDAGChecker dagChecker{ - target, - propertyName, - nullptr, - dagCheckerParent, - context.LG, - context.Config, - target->GetBacktrace(), + target, propertyName, nullptr, + dagCheckerParent, context, target->GetBacktrace(), }; switch (dagChecker.Check()) { case cmGeneratorExpressionDAGChecker::SELF_REFERENCE: @@ -107,8 +102,7 @@ void AddLangSpecificImplicitIncludeDirectories( target->GetLinkImplementationLibraries(config, UseTo::Compile)) { cm::GenEx::Context context(target->LocalGenerator, config, lang); cmGeneratorExpressionDAGChecker dagChecker{ - target, propertyName, nullptr, nullptr, context.LG, - context.Config, target->GetBacktrace(), + target, propertyName, nullptr, nullptr, context, target->GetBacktrace(), }; for (cmLinkImplItem const& library : libraries->Libraries) { @@ -232,7 +226,7 @@ std::vector> cmGeneratorTarget::GetIncludeDirectories( cm::GenEx::Context context(this->LocalGenerator, config, lang); cmGeneratorExpressionDAGChecker dagChecker{ - this, "INCLUDE_DIRECTORIES", nullptr, nullptr, context.LG, context.Config, + this, "INCLUDE_DIRECTORIES", nullptr, nullptr, context, }; cmList debugProperties{ this->Makefile->GetDefinition( diff --git a/Source/cmGeneratorTarget_Link.cxx b/Source/cmGeneratorTarget_Link.cxx index 370d4711de..f33d4c8652 100644 --- a/Source/cmGeneratorTarget_Link.cxx +++ b/Source/cmGeneratorTarget_Link.cxx @@ -549,8 +549,7 @@ void cmGeneratorTarget::ExpandLinkItems(std::string const& prop, prop, nullptr, nullptr, - context.LG, - context.Config, + context, cmListFileBacktrace(), cmGeneratorExpressionDAGChecker::ComputingLinkLibraries::Yes, }; @@ -1149,8 +1148,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries( "LINK_LIBRARIES", nullptr, nullptr, - context.LG, - context.Config, + context, cmListFileBacktrace(), cmGeneratorExpressionDAGChecker::ComputingLinkLibraries::Yes, }; diff --git a/Source/cmGeneratorTarget_LinkDirectories.cxx b/Source/cmGeneratorTarget_LinkDirectories.cxx index 8360dbe72f..693af0d6b8 100644 --- a/Source/cmGeneratorTarget_LinkDirectories.cxx +++ b/Source/cmGeneratorTarget_LinkDirectories.cxx @@ -124,9 +124,8 @@ std::vector> cmGeneratorTarget::GetLinkDirectories( std::unordered_set uniqueDirectories; cm::GenEx::Context context(this->LocalGenerator, config, language); - cmGeneratorExpressionDAGChecker dagChecker{ - this, "LINK_DIRECTORIES", nullptr, nullptr, context.LG, context.Config, + this, "LINK_DIRECTORIES", nullptr, nullptr, context, }; cmList debugProperties{ this->Makefile->GetDefinition( diff --git a/Source/cmGeneratorTarget_Options.cxx b/Source/cmGeneratorTarget_Options.cxx index ec623f6a51..aad968d12e 100644 --- a/Source/cmGeneratorTarget_Options.cxx +++ b/Source/cmGeneratorTarget_Options.cxx @@ -234,7 +234,7 @@ std::vector> cmGeneratorTarget::GetCompileOptions( cm::GenEx::Context context(this->LocalGenerator, config, language); cmGeneratorExpressionDAGChecker dagChecker{ - this, "COMPILE_OPTIONS", nullptr, nullptr, context.LG, context.Config, + this, "COMPILE_OPTIONS", nullptr, nullptr, context, }; cmList debugProperties{ this->Makefile->GetDefinition( @@ -279,7 +279,7 @@ std::vector> cmGeneratorTarget::GetCompileFeatures( /*language=*/std::string()); cmGeneratorExpressionDAGChecker dagChecker{ - this, "COMPILE_FEATURES", nullptr, nullptr, context.LG, context.Config, + this, "COMPILE_FEATURES", nullptr, nullptr, context, }; cmList debugProperties{ this->Makefile->GetDefinition( @@ -331,7 +331,7 @@ std::vector> cmGeneratorTarget::GetCompileDefinitions( cm::GenEx::Context context(this->LocalGenerator, config, language); cmGeneratorExpressionDAGChecker dagChecker{ - this, "COMPILE_DEFINITIONS", nullptr, nullptr, context.LG, context.Config, + this, "COMPILE_DEFINITIONS", nullptr, nullptr, context, }; cmList debugProperties{ this->Makefile->GetDefinition( @@ -371,7 +371,7 @@ std::vector> cmGeneratorTarget::GetPrecompileHeaders( cm::GenEx::Context context(this->LocalGenerator, config, language); cmGeneratorExpressionDAGChecker dagChecker{ - this, "PRECOMPILE_HEADERS", nullptr, nullptr, context.LG, context.Config, + this, "PRECOMPILE_HEADERS", nullptr, nullptr, context, }; cmList debugProperties{ this->Makefile->GetDefinition( @@ -432,7 +432,7 @@ std::vector> cmGeneratorTarget::GetLinkOptions( cm::GenEx::Context context(this->LocalGenerator, config, language); cmGeneratorExpressionDAGChecker dagChecker{ - this, "LINK_OPTIONS", nullptr, nullptr, context.LG, context.Config, + this, "LINK_OPTIONS", nullptr, nullptr, context, }; cmList debugProperties{ this->Makefile->GetDefinition( @@ -617,8 +617,7 @@ std::vector> cmGeneratorTarget::GetStaticLibraryLinkOptions( cm::GenEx::Context context(this->LocalGenerator, config, language); cmGeneratorExpressionDAGChecker dagChecker{ - this, "STATIC_LIBRARY_OPTIONS", nullptr, nullptr, - context.LG, context.Config, + this, "STATIC_LIBRARY_OPTIONS", nullptr, nullptr, context, }; EvaluatedTargetPropertyEntries entries; @@ -663,7 +662,7 @@ std::vector> cmGeneratorTarget::GetLinkDepends( std::unordered_set uniqueOptions; cm::GenEx::Context context(this->LocalGenerator, config, language); cmGeneratorExpressionDAGChecker dagChecker{ - this, "LINK_DEPENDS", nullptr, nullptr, context.LG, context.Config, + this, "LINK_DEPENDS", nullptr, nullptr, context, }; EvaluatedTargetPropertyEntries entries; diff --git a/Source/cmGeneratorTarget_Sources.cxx b/Source/cmGeneratorTarget_Sources.cxx index 586c8c01eb..25d8b2d7d0 100644 --- a/Source/cmGeneratorTarget_Sources.cxx +++ b/Source/cmGeneratorTarget_Sources.cxx @@ -247,7 +247,7 @@ std::vector> cmGeneratorTarget::GetSourceFilePaths( /*language=*/std::string()); cmGeneratorExpressionDAGChecker dagChecker{ - this, "SOURCES", nullptr, nullptr, context.LG, context.Config, + this, "SOURCES", nullptr, nullptr, context, }; EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries( diff --git a/Source/cmGeneratorTarget_TransitiveProperty.cxx b/Source/cmGeneratorTarget_TransitiveProperty.cxx index cce4e43426..a6ab68c2d3 100644 --- a/Source/cmGeneratorTarget_TransitiveProperty.cxx +++ b/Source/cmGeneratorTarget_TransitiveProperty.cxx @@ -112,13 +112,7 @@ std::string cmGeneratorTarget::EvaluateInterfaceProperty( // a subset of TargetPropertyNode::Evaluate without stringify/parse steps // but sufficient for transitive interface properties. cmGeneratorExpressionDAGChecker dagChecker{ - this, - prop, - nullptr, - dagCheckerParent, - eval->Context.LG, - eval->Context.Config, - eval->Backtrace, + this, prop, nullptr, dagCheckerParent, eval->Context, eval->Backtrace, }; switch (dagChecker.Check()) { case cmGeneratorExpressionDAGChecker::SELF_REFERENCE: diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index a7bbc8c16a..7343edcc54 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1969,8 +1969,7 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo() if (!cfg.empty()) { cm::GenEx::Context context(this->LocalGen, cfg, "CXX"); cmGeneratorExpressionDAGChecker dagChecker{ - this->GenTarget, "AUTOMOC_MACRO_NAMES", nullptr, nullptr, - context.LG, context.Config, + this->GenTarget, "AUTOMOC_MACRO_NAMES", nullptr, nullptr, context, }; AddInterfaceEntries( this->GenTarget, context.Config, "INTERFACE_AUTOMOC_MACRO_NAMES", @@ -1981,8 +1980,7 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo() } else { cm::GenEx::Context context(this->LocalGen, this->ConfigDefault, "CXX"); cmGeneratorExpressionDAGChecker dagChecker{ - this->GenTarget, "AUTOMOC_MACRO_NAMES", nullptr, nullptr, - context.LG, context.Config, + this->GenTarget, "AUTOMOC_MACRO_NAMES", nullptr, nullptr, context, }; AddInterfaceEntries(this->GenTarget, context.Config, "INTERFACE_AUTOMOC_MACRO_NAMES", context.Language,