summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget_TransitiveProperty.cxx
diff options
context:
space:
mode:
authorMichael Herwig <develop@michael-herwig.de>2024-05-31 16:15:55 (GMT)
committerMichael Herwig <develop@michael-herwig.de>2024-09-10 11:24:24 (GMT)
commit4a11772618decd7af2da96af41c1c595693fb17a (patch)
tree4a92e66bb0842d891ad499074faba044c1efdefa /Source/cmGeneratorTarget_TransitiveProperty.cxx
parent9673f61be1573b7e2b701da8a6ad0fb4c8cac4a1 (diff)
downloadCMake-4a11772618decd7af2da96af41c1c595693fb17a.zip
CMake-4a11772618decd7af2da96af41c1c595693fb17a.tar.gz
CMake-4a11772618decd7af2da96af41c1c595693fb17a.tar.bz2
GenEx: Limit TARGET_PROPERTY transitive closure optimization to subgraphs
Fixes: #25728
Diffstat (limited to 'Source/cmGeneratorTarget_TransitiveProperty.cxx')
-rw-r--r--Source/cmGeneratorTarget_TransitiveProperty.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget_TransitiveProperty.cxx b/Source/cmGeneratorTarget_TransitiveProperty.cxx
index ac929eb..8c2b8a9 100644
--- a/Source/cmGeneratorTarget_TransitiveProperty.cxx
+++ b/Source/cmGeneratorTarget_TransitiveProperty.cxx
@@ -99,6 +99,15 @@ std::string cmGeneratorTarget::EvaluateInterfaceProperty(
std::string const& prop, cmGeneratorExpressionContext* context,
cmGeneratorExpressionDAGChecker* dagCheckerParent, UseTo usage) const
{
+ return EvaluateInterfaceProperty(prop, context, dagCheckerParent, usage,
+ TransitiveClosure::Inherit);
+}
+
+std::string cmGeneratorTarget::EvaluateInterfaceProperty(
+ std::string const& prop, cmGeneratorExpressionContext* context,
+ cmGeneratorExpressionDAGChecker* dagCheckerParent, UseTo usage,
+ TransitiveClosure closure) const
+{
std::string result;
// If the property does not appear transitively at all, we are done.
@@ -106,12 +115,15 @@ std::string cmGeneratorTarget::EvaluateInterfaceProperty(
return result;
}
+ auto const dagClosure = closure == TransitiveClosure::Inherit
+ ? cmGeneratorExpressionDAGChecker::INHERIT
+ : cmGeneratorExpressionDAGChecker::SUBGRAPH;
// Evaluate $<TARGET_PROPERTY:this,prop> as if it were compiled. This is
// a subset of TargetPropertyNode::Evaluate without stringify/parse steps
// but sufficient for transitive interface properties.
cmGeneratorExpressionDAGChecker dagChecker(
context->Backtrace, this, prop, nullptr, dagCheckerParent,
- this->LocalGenerator, context->Config);
+ this->LocalGenerator, context->Config, dagClosure);
switch (dagChecker.Check()) {
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
dagChecker.ReportError(