cmTarget: De-duplicate link interface genex code for $<LINK_ONLY>
Simplify the implementation of GetTransitivePropertyTargets by using ExpandLinkItems with usage_requirements_only==true to evaluate the generator expressions in the link interface for us.
This commit is contained in:
parent
1001490df2
commit
b030a7f1ca
|
@ -6235,24 +6235,16 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config,
|
||||||
}
|
}
|
||||||
|
|
||||||
// The interface libraries have been explicitly set.
|
// The interface libraries have been explicitly set.
|
||||||
cmGeneratorExpression ge;
|
std::vector<cmLinkItem> libs;
|
||||||
cmGeneratorExpressionDAGChecker dagChecker(this->GetName(),
|
this->ExpandLinkItems(linkIfaceProp, interfaceLibs, config,
|
||||||
linkIfaceProp, 0, 0);
|
headTarget, true, libs);
|
||||||
dagChecker.SetTransitivePropertiesOnly();
|
|
||||||
std::vector<std::string> libs;
|
|
||||||
cmSystemTools::ExpandListArgument(ge.Parse(interfaceLibs)->Evaluate(
|
|
||||||
this->Makefile,
|
|
||||||
config,
|
|
||||||
false,
|
|
||||||
headTarget,
|
|
||||||
this, &dagChecker), libs);
|
|
||||||
|
|
||||||
for(std::vector<std::string>::const_iterator it = libs.begin();
|
for(std::vector<cmLinkItem>::const_iterator it = libs.begin();
|
||||||
it != libs.end(); ++it)
|
it != libs.end(); ++it)
|
||||||
{
|
{
|
||||||
if (cmTarget const* tgt = this->FindTargetToLink(*it))
|
if (it->Target)
|
||||||
{
|
{
|
||||||
tgts.push_back(tgt);
|
tgts.push_back(it->Target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue