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:
Stephen Kelly 2013-06-04 16:17:18 +02:00
parent 14eb4a1dc7
commit 5aa9731c9f
3 changed files with 25 additions and 5 deletions

View File

@ -900,13 +900,14 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if (std::find_if(transBegin, transEnd, if (std::find_if(transBegin, transEnd,
TransitiveWhitelistCompare(propertyName)) != transEnd) TransitiveWhitelistCompare(propertyName)) != transEnd)
{ {
const cmTarget::LinkInterface *iface = target->GetLinkInterface(
context->Config, std::vector<std::string> libs;
headTarget); target->GetTransitivePropertyLinkLibraries(context->Config,
if(iface) headTarget, libs);
if (!libs.empty())
{ {
linkedTargetsContent = linkedTargetsContent =
getLinkedTargetsContent(iface->Libraries, target, getLinkedTargetsContent(libs, target,
headTarget, headTarget,
context, &dagChecker, context, &dagChecker,
interfacePropertyName); interfacePropertyName);

View File

@ -6001,6 +6001,22 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config,
return i->second.Exists? &i->second : 0; 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, bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
cmTarget *headTarget) cmTarget *headTarget)

View File

@ -276,6 +276,9 @@ public:
if the target cannot be linked. */ if the target cannot be linked. */
LinkInterface const* GetLinkInterface(const char* config, LinkInterface const* GetLinkInterface(const char* config,
cmTarget *headTarget); cmTarget *headTarget);
void GetTransitivePropertyLinkLibraries(const char* config,
cmTarget *headTarget,
std::vector<std::string> &libs);
/** The link implementation specifies the direct library /** The link implementation specifies the direct library
dependencies needed by the object files of the target. */ dependencies needed by the object files of the target. */