GenexEval: Add abstracted access to link interface for a target.
This can be extended with special handling for static libraries so that we can process the link dependencies separately from the usage dependencies.
This commit is contained in:
parent
14eb4a1dc7
commit
5aa9731c9f
|
@ -900,13 +900,14 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
|
|||
if (std::find_if(transBegin, transEnd,
|
||||
TransitiveWhitelistCompare(propertyName)) != transEnd)
|
||||
{
|
||||
const cmTarget::LinkInterface *iface = target->GetLinkInterface(
|
||||
context->Config,
|
||||
headTarget);
|
||||
if(iface)
|
||||
|
||||
std::vector<std::string> libs;
|
||||
target->GetTransitivePropertyLinkLibraries(context->Config,
|
||||
headTarget, libs);
|
||||
if (!libs.empty())
|
||||
{
|
||||
linkedTargetsContent =
|
||||
getLinkedTargetsContent(iface->Libraries, target,
|
||||
getLinkedTargetsContent(libs, target,
|
||||
headTarget,
|
||||
context, &dagChecker,
|
||||
interfacePropertyName);
|
||||
|
|
|
@ -6001,6 +6001,22 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config,
|
|||
return i->second.Exists? &i->second : 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmTarget::GetTransitivePropertyLinkLibraries(
|
||||
const char* config,
|
||||
cmTarget *headTarget,
|
||||
std::vector<std::string> &libs)
|
||||
{
|
||||
cmTarget::LinkInterface const* iface = this->GetLinkInterface(config,
|
||||
headTarget);
|
||||
if (!iface)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
libs = iface->Libraries;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
|
||||
cmTarget *headTarget)
|
||||
|
|
|
@ -276,6 +276,9 @@ public:
|
|||
if the target cannot be linked. */
|
||||
LinkInterface const* GetLinkInterface(const char* config,
|
||||
cmTarget *headTarget);
|
||||
void GetTransitivePropertyLinkLibraries(const char* config,
|
||||
cmTarget *headTarget,
|
||||
std::vector<std::string> &libs);
|
||||
|
||||
/** The link implementation specifies the direct library
|
||||
dependencies needed by the object files of the target. */
|
||||
|
|
Loading…
Reference in New Issue