summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-15 15:14:49 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-16 17:28:44 (GMT)
commit0400cd5dd1be33ebcc2c2d5dba8233a78b1cee68 (patch)
tree979184257bfc93bfe422bcc489169f97377f405f /Source/cmTarget.cxx
parenta0dc1354fe5effa1ff484b441595f8bdb6da3533 (diff)
downloadCMake-0400cd5dd1be33ebcc2c2d5dba8233a78b1cee68.zip
CMake-0400cd5dd1be33ebcc2c2d5dba8233a78b1cee68.tar.gz
CMake-0400cd5dd1be33ebcc2c2d5dba8233a78b1cee68.tar.bz2
Make $<LINK_ONLY> available to projects (#14751)
Previously this generator expression was used internally by the target_link_libraries command to honor private linking requirements of static libraries in their INTERFACE_LINK_LIBRARIES. Remove the check that limits $<LINK_ONLY> to this use case to make it available for project code to use too.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b4688c4..ffdeb6a 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3555,6 +3555,8 @@ void cmTarget::ExpandLinkItems(std::string const& prop,
{
cmGeneratorExpression ge;
cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, 0, 0);
+ // The $<LINK_ONLY> expression may be in a link interface to specify private
+ // link dependencies that are otherwise excluded from usage requirements.
if(usage_requirements_only)
{
dagChecker.SetTransitivePropertiesOnly();
@@ -6057,18 +6059,8 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
cmTarget const* headTarget,
std::vector<cmTarget const*> &tgts) const
{
- // The $<LINK_ONLY> expression may be in a link interface to specify private
- // link dependencies that are otherwise excluded from usage requirements.
- // Currently $<LINK_ONLY> is internal to CMake and only ever added by
- // target_link_libraries for PRIVATE dependencies of STATIC libraries in
- // INTERFACE_LINK_LIBRARIES which is used under CMP0022 NEW behavior.
- bool usage_requirements_only =
- this->GetType() == STATIC_LIBRARY &&
- this->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
- this->GetPolicyStatusCMP0022() != cmPolicies::OLD;
if(cmTarget::LinkInterface const* iface =
- this->GetLinkInterfaceLibraries(config, headTarget,
- usage_requirements_only))
+ this->GetLinkInterfaceLibraries(config, headTarget, true))
{
for(std::vector<cmLinkItem>::const_iterator it = iface->Libraries.begin();
it != iface->Libraries.end(); ++it)