diff options
author | Brad King <brad.king@kitware.com> | 2014-06-16 18:23:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-06-25 13:32:21 (GMT) |
commit | 1001490df27f3ab93f8a37a6f6c3b33aa26d22e2 (patch) | |
tree | 9916a6104b729ad098be7aa747e14f83737dcbc6 | |
parent | f5c18c9c1c0434f3481b1684af5fe6e0ea823f87 (diff) | |
download | CMake-1001490df27f3ab93f8a37a6f6c3b33aa26d22e2.zip CMake-1001490df27f3ab93f8a37a6f6c3b33aa26d22e2.tar.gz CMake-1001490df27f3ab93f8a37a6f6c3b33aa26d22e2.tar.bz2 |
cmTarget: Teach ExpandLinkItems how to support $<LINK_ONLY>
Add a 'usage_requirements_only' parameter to ExpandLinkItems so that it
knows whether to use SetTransitivePropertiesOnly while evaluating
generator expressions. Update existing call sites to pass 'false' since
they are for linking and not usage requirements.
-rw-r--r-- | Source/cmTarget.cxx | 11 | ||||
-rw-r--r-- | Source/cmTarget.h | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 71d03df..32948cd 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3688,10 +3688,15 @@ void cmTarget::ExpandLinkItems(std::string const& prop, std::string const& value, std::string const& config, cmTarget const* headTarget, + bool usage_requirements_only, std::vector<cmLinkItem>& items) const { cmGeneratorExpression ge; cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), prop, 0, 0); + if(usage_requirements_only) + { + dagChecker.SetTransitivePropertiesOnly(); + } std::vector<std::string> libs; cmSystemTools::ExpandListArgument(ge.Parse(value)->Evaluate( this->Makefile, @@ -6135,7 +6140,7 @@ cmTarget::GetImportLinkInterface(const std::string& config, iface.Multiplicity = info->Multiplicity; cmSystemTools::ExpandListArgument(info->Languages, iface.Languages); this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config, - headTarget, iface.Libraries); + headTarget, false, iface.Libraries); { std::vector<std::string> deps; cmSystemTools::ExpandListArgument(info->SharedDeps, deps); @@ -6341,7 +6346,7 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config, { // The interface libraries have been explicitly set. this->ExpandLinkItems(linkIfaceProp, explicitLibraries, config, - headTarget, iface.Libraries); + headTarget, false, iface.Libraries); } else if (this->PolicyStatusCMP0022 == cmPolicies::WARN || this->PolicyStatusCMP0022 == cmPolicies::OLD) @@ -6364,7 +6369,7 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config, if(const char* newExplicitLibraries = this->GetProperty(newProp)) { this->ExpandLinkItems(newProp, newExplicitLibraries, config, - headTarget, ifaceLibs); + headTarget, false, ifaceLibs); } if (ifaceLibs != impl->Libraries) { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 3f534f2..4930d70 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -777,6 +777,7 @@ private: void ExpandLinkItems(std::string const& prop, std::string const& value, std::string const& config, cmTarget const* headTarget, + bool usage_requirements_only, std::vector<cmLinkItem>& items) const; void LookupLinkItems(std::vector<std::string> const& names, std::vector<cmLinkItem>& items) const; |