From cb69f750bfe650b3170e9c098ceacdc633b63c3b Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 26 Sep 2025 17:41:41 -0400 Subject: [PATCH] cmGeneratorTarget: Factor out helper to detect LINK_LIBRARIES evaluation --- Source/cmGeneratorTarget_TransitiveProperty.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmGeneratorTarget_TransitiveProperty.cxx b/Source/cmGeneratorTarget_TransitiveProperty.cxx index 81072f28b9..4f3c478806 100644 --- a/Source/cmGeneratorTarget_TransitiveProperty.cxx +++ b/Source/cmGeneratorTarget_TransitiveProperty.cxx @@ -30,6 +30,11 @@ namespace { using UseTo = cmGeneratorTarget::UseTo; using TransitiveProperty = cmGeneratorTarget::TransitiveProperty; + +bool ComputingLinkLibraries(cmGeneratorExpressionDAGChecker const* dagChecker) +{ + return dagChecker && dagChecker->IsComputingLinkLibraries(); +} } std::map const @@ -206,7 +211,7 @@ cmGeneratorTarget::IsTransitiveProperty( result->Usage = cmGeneratorTarget::UseTo::Compile; } } - } else if (!dagChecker || !dagChecker->IsComputingLinkLibraries()) { + } else if (!ComputingLinkLibraries(dagChecker)) { // Honor TRANSITIVE_COMPILE_PROPERTIES and TRANSITIVE_LINK_PROPERTIES // from the link closure when we are not evaluating the closure itself. CustomTransitiveProperties const& ctp =