summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 6c804b5..1a13bdb 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -8152,6 +8152,20 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
// Keep this logic in sync with ExpandLinkItems.
cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_LIBRARIES", nullptr,
nullptr);
+ // The $<LINK_ONLY> expression may be used to specify link dependencies
+ // that are otherwise excluded from usage requirements.
+ if (implFor == LinkInterfaceFor::Usage) {
+ switch (this->GetPolicyStatusCMP0131()) {
+ case cmPolicies::WARN:
+ case cmPolicies::OLD:
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ dagChecker.SetTransitivePropertiesOnly();
+ break;
+ }
+ }
cmGeneratorExpression ge(entry.Backtrace);
std::unique_ptr<cmCompiledGeneratorExpression> const cge =
ge.Parse(entry.Value);