1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

cmGeneratorTarget: Pass genex evaluation context to IsTransitiveProperty

This commit is contained in:
Brad King
2025-09-22 09:46:57 -04:00
parent 6201ff1864
commit 9b862e7013
4 changed files with 7 additions and 11 deletions

View File

@@ -35,9 +35,7 @@ cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
this->TopIsTransitiveProperty = parent->TopIsTransitiveProperty;
} else {
this->TopIsTransitiveProperty =
this->Target
->IsTransitiveProperty(this->Property, context.LG, context.Config,
this)
this->Target->IsTransitiveProperty(this->Property, context, this)
.has_value();
}

View File

@@ -2887,8 +2887,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
cmGeneratorTarget::UseTo usage = cmGeneratorTarget::UseTo::Compile;
if (cm::optional<cmGeneratorTarget::TransitiveProperty> transitiveProp =
target->IsTransitiveProperty(propertyName, eval->Context.LG,
eval->Context.Config,
target->IsTransitiveProperty(propertyName, eval->Context,
dagCheckerParent)) {
interfacePropertyName = std::string(transitiveProp->InterfaceName);
isInterfaceProperty = transitiveProp->InterfaceName == propertyName;

View File

@@ -1012,8 +1012,7 @@ public:
BuiltinTransitiveProperties;
cm::optional<TransitiveProperty> IsTransitiveProperty(
cm::string_view prop, cmLocalGenerator const* lg,
std::string const& config,
cm::string_view prop, cm::GenEx::Context const& context,
cmGeneratorExpressionDAGChecker const* dagChecker) const;
bool HaveInstallTreeRPATH(std::string const& config) const;

View File

@@ -177,7 +177,7 @@ std::string cmGeneratorTarget::EvaluateInterfaceProperty(
cm::optional<cmGeneratorTarget::TransitiveProperty>
cmGeneratorTarget::IsTransitiveProperty(
cm::string_view prop, cmLocalGenerator const* lg, std::string const& config,
cm::string_view prop, cm::GenEx::Context const& context,
cmGeneratorExpressionDAGChecker const* dagChecker) const
{
cm::optional<TransitiveProperty> result;
@@ -192,7 +192,7 @@ cmGeneratorTarget::IsTransitiveProperty(
if (i != BuiltinTransitiveProperties.end() &&
// Look up CMP0189 in the context where evaluation occurs,
// not where the target was created.
lg->GetPolicyStatus(cmPolicies::CMP0189) != cmPolicies::NEW &&
context.LG->GetPolicyStatus(cmPolicies::CMP0189) != cmPolicies::NEW &&
prop == "LINK_LIBRARIES"_s) {
i = BuiltinTransitiveProperties.end();
}
@@ -200,7 +200,7 @@ cmGeneratorTarget::IsTransitiveProperty(
result = i->second;
if (result->Usage != cmGeneratorTarget::UseTo::Compile) {
cmPolicies::PolicyStatus cmp0166 =
lg->GetPolicyStatus(cmPolicies::CMP0166);
context.LG->GetPolicyStatus(cmPolicies::CMP0166);
if ((cmp0166 == cmPolicies::WARN || cmp0166 == cmPolicies::OLD) &&
(prop == "LINK_DIRECTORIES"_s || prop == "LINK_DEPENDS"_s ||
prop == "LINK_OPTIONS"_s)) {
@@ -211,7 +211,7 @@ cmGeneratorTarget::IsTransitiveProperty(
// Honor TRANSITIVE_COMPILE_PROPERTIES and TRANSITIVE_LINK_PROPERTIES
// from the link closure when we are not evaluating the closure itself.
CustomTransitiveProperties const& ctp =
this->GetCustomTransitiveProperties(config, propertyFor);
this->GetCustomTransitiveProperties(context.Config, propertyFor);
auto ci = ctp.find(std::string(prop));
if (ci != ctp.end()) {
result = ci->second;