summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-19 17:48:28 (GMT)
committerBrad King <brad.king@kitware.com>2014-06-25 14:33:36 (GMT)
commit24637979962012ae170f7848ad69e896f8d3f67c (patch)
treea4caffb1989c6aa9662ea23e30565d5884afc547 /Source
parent7812d2a912ca596d3db9d28a9291e83a55ffe75c (diff)
downloadCMake-24637979962012ae170f7848ad69e896f8d3f67c.zip
CMake-24637979962012ae170f7848ad69e896f8d3f67c.tar.gz
CMake-24637979962012ae170f7848ad69e896f8d3f67c.tar.bz2
cmTarget: Refactor ComputeLinkImplementation
Use LinkImplementationPropertyEntries directly instead of asking GetProperty to construct a string for LINK_LIBRARIES. This gives us access to the entry backtraces.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx37
1 files changed, 20 insertions, 17 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 910d951..aa0ed56 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6579,15 +6579,18 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
cmTarget const* head) const
{
// Collect libraries directly linked in this configuration.
- std::vector<std::string> llibs;
- if(const char *prop = this->GetProperty("LINK_LIBRARIES"))
+ for (std::vector<cmValueWithOrigin>::const_iterator
+ le = this->Internal->LinkImplementationPropertyEntries.begin(),
+ end = this->Internal->LinkImplementationPropertyEntries.end();
+ le != end; ++le)
{
- cmGeneratorExpression ge;
- const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
-
+ std::vector<std::string> llibs;
cmGeneratorExpressionDAGChecker dagChecker(
this->GetName(),
"LINK_LIBRARIES", 0, 0);
+ cmGeneratorExpression ge(&le->Backtrace);
+ cmsys::auto_ptr<cmCompiledGeneratorExpression> const cge =
+ ge.Parse(le->Value);
cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
config,
false,
@@ -6595,18 +6598,6 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
&dagChecker),
llibs);
- std::set<std::string> const& seenProps = cge->GetSeenTargetProperties();
- for (std::set<std::string>::const_iterator it = seenProps.begin();
- it != seenProps.end(); ++it)
- {
- if (!this->GetProperty(*it))
- {
- this->LinkImplicitNullProperties.insert(*it);
- }
- }
- cge->GetMaxLanguageStandard(this, this->MaxLanguageStandards);
- }
-
for(std::vector<std::string>::const_iterator li = llibs.begin();
li != llibs.end(); ++li)
{
@@ -6656,6 +6647,18 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
cmLinkItem(name, this->FindTargetToLink(name)));
}
+ std::set<std::string> const& seenProps = cge->GetSeenTargetProperties();
+ for (std::set<std::string>::const_iterator it = seenProps.begin();
+ it != seenProps.end(); ++it)
+ {
+ if (!this->GetProperty(*it))
+ {
+ this->LinkImplicitNullProperties.insert(*it);
+ }
+ }
+ cge->GetMaxLanguageStandard(this, this->MaxLanguageStandards);
+ }
+
cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
LinkLibraryVectorType const& oldllibs = this->GetOriginalLinkLibraries();
for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();