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,
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);

View File

@ -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)

View File

@ -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. */