summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmComputeLinkDepends.cxx12
-rw-r--r--Source/cmComputeTargetDepends.cxx2
-rw-r--r--Source/cmExportFileGenerator.cxx8
-rw-r--r--Source/cmGeneratorTarget.cxx55
-rw-r--r--Source/cmGeneratorTarget.h4
-rw-r--r--Source/cmTarget.cxx47
-rw-r--r--Source/cmTarget.h4
7 files changed, 69 insertions, 63 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 03ec820..5e9627b 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -360,9 +360,11 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
// Follow the item's dependencies.
if(entry.Target)
{
+ cmGeneratorTarget* gtgt =
+ this->GlobalGenerator->GetGeneratorTarget(entry.Target);
// Follow the target dependencies.
if(cmLinkInterface const* iface =
- entry.Target->GetLinkInterface(this->Config, this->Target->Target))
+ gtgt->GetLinkInterface(this->Config, this->Target->Target))
{
const bool isIface =
entry.Target->GetType() == cmTarget::INTERFACE_LIBRARY;
@@ -459,8 +461,10 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
// Target items may have their own dependencies.
if(entry.Target)
{
+ cmGeneratorTarget* gtgt =
+ this->GlobalGenerator->GetGeneratorTarget(entry.Target);
if(cmLinkInterface const* iface =
- entry.Target->GetLinkInterface(this->Config, this->Target->Target))
+ gtgt->GetLinkInterface(this->Config, this->Target->Target))
{
// Follow public and private dependencies transitively.
this->FollowSharedDeps(index, iface, true);
@@ -930,8 +934,10 @@ int cmComputeLinkDepends::ComputeComponentCount(NodeList const& nl)
{
if(cmTarget const* target = this->EntryList[*ni].Target)
{
+ cmGeneratorTarget* gtgt =
+ this->GlobalGenerator->GetGeneratorTarget(target);
if(cmLinkInterface const* iface =
- target->GetLinkInterface(this->Config, this->Target->Target))
+ gtgt->GetLinkInterface(this->Config, this->Target->Target))
{
if(iface->Multiplicity > count)
{
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index aeb9184..83b2a0e 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -297,7 +297,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
{
cmGeneratorTarget const* depender = this->Targets[depender_index];
if(cmLinkInterface const* iface =
- dependee->Target->GetLinkInterface(config,
+ dependee->GetLinkInterface(config,
depender->Target))
{
for(std::vector<cmLinkItem>::const_iterator
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index d559a07..9a7d73f 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -796,9 +796,8 @@ cmExportFileGenerator
std::vector<std::string>& missingTargets)
{
// Add the transitive link dependencies for this configuration.
- cmLinkInterface const* iface = target->Target->GetLinkInterface(
- config,
- target->Target);
+ cmLinkInterface const* iface = target->GetLinkInterface(config,
+ target->Target);
if (!iface)
{
return;
@@ -910,8 +909,7 @@ cmExportFileGenerator
// Add the transitive link dependencies for this configuration.
if(cmLinkInterface const* iface =
- target->Target
- ->GetLinkInterface(config, target->Target))
+ target->GetLinkInterface(config, target->Target))
{
this->SetImportLinkProperty(suffix, target,
"IMPORTED_LINK_INTERFACE_LANGUAGES",
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 06a4c6a..5d84309 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1172,9 +1172,11 @@ public:
{
return;
}
-
+ cmGeneratorTarget* gtgt =
+ this->Target->GetLocalGenerator()->GetGlobalGenerator()
+ ->GetGeneratorTarget(item.Target);
cmLinkInterface const* iface =
- item.Target->GetLinkInterface(this->Config, this->HeadTarget);
+ gtgt->GetLinkInterface(this->Config, this->HeadTarget);
if(!iface) { return; }
for(std::vector<std::string>::const_iterator
@@ -3354,3 +3356,52 @@ cmGeneratorTarget::ReportPropertyOrigin(const std::string &p,
this->Makefile->GetCMakeInstance()->IssueMessage(cmake::LOG, areport);
}
+
+//----------------------------------------------------------------------------
+cmLinkInterface const*
+cmGeneratorTarget::GetLinkInterface(const std::string& config,
+ cmTarget const* head) const
+{
+ // Imported targets have their own link interface.
+ if(this->IsImported())
+ {
+ return this->Target->GetImportLinkInterface(config, head, false);
+ }
+
+ // Link interfaces are not supported for executables that do not
+ // export symbols.
+ if(this->GetType() == cmTarget::EXECUTABLE &&
+ !this->Target->IsExecutableWithExports())
+ {
+ return 0;
+ }
+
+ // Lookup any existing link interface for this configuration.
+ cmHeadToLinkInterfaceMap& hm =
+ this->Target->GetHeadToLinkInterfaceMap(config);
+
+ // If the link interface does not depend on the head target
+ // then return the one we computed first.
+ if(!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition)
+ {
+ return &hm.begin()->second;
+ }
+
+ cmOptionalLinkInterface& iface = hm[head];
+ if(!iface.LibrariesDone)
+ {
+ iface.LibrariesDone = true;
+ this->Target->ComputeLinkInterfaceLibraries(
+ config, iface, head, false);
+ }
+ if(!iface.AllDone)
+ {
+ iface.AllDone = true;
+ if(iface.Exists)
+ {
+ this->Target->ComputeLinkInterface(config, iface, head);
+ }
+ }
+
+ return iface.Exists? &iface : 0;
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 15b3335..2dbb502 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -12,7 +12,7 @@
#ifndef cmGeneratorTarget_h
#define cmGeneratorTarget_h
-#include "cmStandardIncludes.h"
+#include "cmLinkItem.h"
class cmCustomCommand;
class cmGlobalGenerator;
@@ -106,6 +106,8 @@ public:
const char *GetLinkInterfaceDependentNumberMaxProperty(const std::string &p,
const std::string& config) const;
+ cmLinkInterface const* GetLinkInterface(const std::string& config,
+ cmTarget const* headTarget) const;
/** Get the full path to the target according to the settings in its
makefile and the configuration type. */
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index fb545b1..ee298ac 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4108,53 +4108,6 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
}
//----------------------------------------------------------------------------
-cmLinkInterface const* cmTarget::GetLinkInterface(const std::string& config,
- cmTarget const* head) const
-{
- // Imported targets have their own link interface.
- if(this->IsImported())
- {
- return this->GetImportLinkInterface(config, head, false);
- }
-
- // Link interfaces are not supported for executables that do not
- // export symbols.
- if(this->GetType() == cmTarget::EXECUTABLE &&
- !this->IsExecutableWithExports())
- {
- return 0;
- }
-
- // Lookup any existing link interface for this configuration.
- cmHeadToLinkInterfaceMap& hm = this->GetHeadToLinkInterfaceMap(config);
-
- // If the link interface does not depend on the head target
- // then return the one we computed first.
- if(!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition)
- {
- return &hm.begin()->second;
- }
-
- cmOptionalLinkInterface& iface = hm[head];
- if(!iface.LibrariesDone)
- {
- iface.LibrariesDone = true;
- this->ComputeLinkInterfaceLibraries(
- config, iface, head, false);
- }
- if(!iface.AllDone)
- {
- iface.AllDone = true;
- if(iface.Exists)
- {
- this->ComputeLinkInterface(config, iface, head);
- }
- }
-
- return iface.Exists? &iface : 0;
-}
-
-//----------------------------------------------------------------------------
const cmLinkInterfaceLibraries *
cmTarget::GetLinkInterfaceLibraries(const std::string& config,
cmTarget const* head,
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 53a8bd6..a8c6e8f 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -241,10 +241,6 @@ public:
cmTarget const* head,
bool usage_requirements_only) const;
- /** Get the link interface for the given configuration. Returns 0
- if the target cannot be linked. */
- cmLinkInterface const* GetLinkInterface(const std::string& config,
- cmTarget const* headTarget) const;
cmLinkInterfaceLibraries const*
GetLinkInterfaceLibraries(const std::string& config,
cmTarget const* headTarget,