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.
This commit is contained in:
parent
7812d2a912
commit
2463797996
@ -6579,15 +6579,18 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
|
|||||||
cmTarget const* head) const
|
cmTarget const* head) const
|
||||||
{
|
{
|
||||||
// Collect libraries directly linked in this configuration.
|
// Collect libraries directly linked in this configuration.
|
||||||
std::vector<std::string> llibs;
|
for (std::vector<cmValueWithOrigin>::const_iterator
|
||||||
if(const char *prop = this->GetProperty("LINK_LIBRARIES"))
|
le = this->Internal->LinkImplementationPropertyEntries.begin(),
|
||||||
|
end = this->Internal->LinkImplementationPropertyEntries.end();
|
||||||
|
le != end; ++le)
|
||||||
{
|
{
|
||||||
cmGeneratorExpression ge;
|
std::vector<std::string> llibs;
|
||||||
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
|
|
||||||
|
|
||||||
cmGeneratorExpressionDAGChecker dagChecker(
|
cmGeneratorExpressionDAGChecker dagChecker(
|
||||||
this->GetName(),
|
this->GetName(),
|
||||||
"LINK_LIBRARIES", 0, 0);
|
"LINK_LIBRARIES", 0, 0);
|
||||||
|
cmGeneratorExpression ge(&le->Backtrace);
|
||||||
|
cmsys::auto_ptr<cmCompiledGeneratorExpression> const cge =
|
||||||
|
ge.Parse(le->Value);
|
||||||
cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
|
cmSystemTools::ExpandListArgument(cge->Evaluate(this->Makefile,
|
||||||
config,
|
config,
|
||||||
false,
|
false,
|
||||||
@ -6595,18 +6598,6 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
|
|||||||
&dagChecker),
|
&dagChecker),
|
||||||
llibs);
|
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();
|
for(std::vector<std::string>::const_iterator li = llibs.begin();
|
||||||
li != llibs.end(); ++li)
|
li != llibs.end(); ++li)
|
||||||
{
|
{
|
||||||
@ -6656,6 +6647,18 @@ void cmTarget::ComputeLinkImplementation(const std::string& config,
|
|||||||
cmLinkItem(name, this->FindTargetToLink(name)));
|
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);
|
cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config);
|
||||||
LinkLibraryVectorType const& oldllibs = this->GetOriginalLinkLibraries();
|
LinkLibraryVectorType const& oldllibs = this->GetOriginalLinkLibraries();
|
||||||
for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
|
for(cmTarget::LinkLibraryVectorType::const_iterator li = oldllibs.begin();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user