From 86f99c5f6db76f2093edf0c5863f962fec93f7e8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 11 Apr 2024 14:49:23 -0400 Subject: GenEx: Add COMPATIBLE_INTERFACE_ implementation comments --- Source/cmGeneratorExpressionNode.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 94803da..e3cb497 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -2950,6 +2950,19 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode return std::string(); } + // Properties named by COMPATIBLE_INTERFACE_ properties combine over + // the transitive link closure as a single order-independent value. + // Imported targets do not themselves have a defined value for these + // properties, but they can contribute to the value of a non-imported + // dependent. + // + // For COMPATIBLE_INTERFACE_{BOOL,STRING}: + // * If set on this target, use the value directly. It is checked + // elsewhere for consistency over the transitive link closure. + // * If not set on this target, compute the value from the closure. + // + // For COMPATIBLE_INTERFACE_NUMBER_{MAX,MIN} we always compute the value + // from this target and the transitive link closure to get the max or min. if (!haveProp && !target->IsImported() && target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { if (target->IsLinkInterfaceDependentBoolProperty(propertyName, @@ -2989,7 +3002,6 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode return propContent ? propContent : ""; } } - if (!target->IsImported() && dagCheckerParent && !dagCheckerParent->EvaluatingLinkLibraries()) { if (target->IsLinkInterfaceDependentNumberMinProperty(propertyName, @@ -3010,6 +3022,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode } } + // Some properties, such as usage requirements, combine over the + // transitive link closure as an ordered list. if (!interfacePropertyName.empty()) { result = cmGeneratorExpression::StripEmptyListElements( this->EvaluateDependentExpression(result, context->LG, context, target, -- cgit v0.12