summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-10-07 23:18:42 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-10-12 16:39:58 (GMT)
commitceb35b63a796235bb76284b3fb4046208365e23f (patch)
treef023761134dfe519e9faa11139b844d141c582bf
parentbf2d061ad37088be9ea6f135a980d14c4e76064b (diff)
downloadCMake-ceb35b63a796235bb76284b3fb4046208365e23f.zip
CMake-ceb35b63a796235bb76284b3fb4046208365e23f.tar.gz
CMake-ceb35b63a796235bb76284b3fb4046208365e23f.tar.bz2
cmLinkItem: Port to cmGeneratorTarget.
-rw-r--r--Source/cmComputeLinkDepends.cxx10
-rw-r--r--Source/cmComputeTargetDepends.cxx24
-rw-r--r--Source/cmGeneratorExpressionNode.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx20
-rw-r--r--Source/cmLinkItem.h7
5 files changed, 25 insertions, 38 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 5604c53..22843f1 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -320,8 +320,7 @@ int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item)
int index = lei->second;
LinkEntry& entry = this->EntryList[index];
entry.Item = item;
- entry.Target =
- item.Target ? this->GlobalGenerator->GetGeneratorTarget(item.Target) : 0;
+ entry.Target = item.Target;
entry.IsFlag = (!entry.Target && item[0] == '-' && item[1] != 'l' &&
item.substr(0, 10) != "-framework");
@@ -443,9 +442,7 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
// Initialize the item entry.
LinkEntry& entry = this->EntryList[lei->second];
entry.Item = dep.Item;
- entry.Target =
- dep.Item.Target ?
- this->GlobalGenerator->GetGeneratorTarget(dep.Item.Target) : 0;
+ entry.Target = dep.Item.Target;
// This item was added specifically because it is a dependent
// shared library. It may get special treatment
@@ -983,7 +980,6 @@ void cmComputeLinkDepends::CheckWrongConfigItem(cmLinkItem const& item)
// directories.
if(item.Target && !item.Target->IsImported())
{
- this->OldWrongConfigItems.insert(
- this->GlobalGenerator->GetGeneratorTarget(item.Target));
+ this->OldWrongConfigItems.insert(item.Target);
}
}
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index e53b7b9..8f3def2 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -319,22 +319,20 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
std::set<std::string> &emitted)
{
cmGeneratorTarget const* depender = this->Targets[depender_index];
- cmTarget const* dependee = dependee_name.Target;
+ cmGeneratorTarget const* dependee = dependee_name.Target;
// Skip targets that will not really be linked. This is probably a
// name conflict between an external library and an executable
// within the project.
if(dependee &&
dependee->GetType() == cmTarget::EXECUTABLE &&
- !dependee->IsExecutableWithExports())
+ !dependee->Target->IsExecutableWithExports())
{
dependee = 0;
}
if(dependee)
{
- cmGeneratorTarget* gt =
- this->GlobalGenerator->GetGeneratorTarget(dependee);
- this->AddInterfaceDepends(depender_index, gt, "", emitted);
+ this->AddInterfaceDepends(depender_index, dependee, "", emitted);
std::vector<std::string> configs;
depender->Makefile->GetConfigurations(configs);
for (std::vector<std::string>::const_iterator it = configs.begin();
@@ -342,7 +340,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
{
// A target should not depend on itself.
emitted.insert(depender->GetName());
- this->AddInterfaceDepends(depender_index, gt, *it, emitted);
+ this->AddInterfaceDepends(depender_index, dependee, *it, emitted);
}
}
}
@@ -356,7 +354,7 @@ void cmComputeTargetDepends::AddTargetDepend(
cmGeneratorTarget const* depender = this->Targets[depender_index];
// Check the target's makefile first.
- cmTarget const* dependee = dependee_name.Target;
+ cmGeneratorTarget const* dependee = dependee_name.Target;
if(!dependee && !linking &&
(depender->GetType() != cmTarget::GLOBAL_TARGET))
@@ -403,16 +401,14 @@ void cmComputeTargetDepends::AddTargetDepend(
// within the project.
if(linking && dependee &&
dependee->GetType() == cmTarget::EXECUTABLE &&
- !dependee->IsExecutableWithExports())
+ !dependee->Target->IsExecutableWithExports())
{
dependee = 0;
}
if(dependee)
{
- cmGeneratorTarget* gt =
- this->GlobalGenerator->GetGeneratorTarget(dependee);
- this->AddTargetDepend(depender_index, gt, linking);
+ this->AddTargetDepend(depender_index, dependee, linking);
}
}
@@ -430,11 +426,9 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
for(std::set<cmLinkItem>::const_iterator i = utils.begin();
i != utils.end(); ++i)
{
- if(cmTarget const* transitive_dependee = i->Target)
+ if(cmGeneratorTarget const* transitive_dependee = i->Target)
{
- cmGeneratorTarget* gt =
- this->GlobalGenerator->GetGeneratorTarget(transitive_dependee);
- this->AddTargetDepend(depender_index, gt, false);
+ this->AddTargetDepend(depender_index, transitive_dependee, false);
}
}
}
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 78a5b6f..7e47261 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -846,7 +846,7 @@ getLinkedTargetsContent(
// Broken code can have a target in its own link interface.
// Don't follow such link interface entries so as not to create a
// self-referencing loop.
- if (it->Target && it->Target != target)
+ if (it->Target && it->Target->Target != target)
{
depString +=
sep + "$<TARGET_PROPERTY:" +
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index d472c6c..f4ffd42 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -773,8 +773,10 @@ std::set<cmLinkItem> const& cmGeneratorTarget::GetUtilityItems() const
for(std::set<std::string>::const_iterator i = utilities.begin();
i != utilities.end(); ++i)
{
- this->UtilityItems.insert(
- cmLinkItem(*i, this->Makefile->FindTargetToUse(*i)));
+ cmTarget* tgt = this->Makefile->FindTargetToUse(*i);
+ cmGeneratorTarget* gt = tgt ? this->GlobalGenerator
+ ->GetGeneratorTarget(tgt) : 0;
+ this->UtilityItems.insert(cmLinkItem(*i, gt));
}
}
return this->UtilityItems;
@@ -1728,15 +1730,12 @@ public:
}
return;
}
- if(!this->Visited.insert(item.Target).second)
+ if(!this->Visited.insert(item.Target->Target).second)
{
return;
}
- cmGeneratorTarget* gtgt =
- this->Target->GetLocalGenerator()->GetGlobalGenerator()
- ->GetGeneratorTarget(item.Target);
cmLinkInterface const* iface =
- gtgt->GetLinkInterface(this->Config, this->HeadTarget);
+ item.Target->GetLinkInterface(this->Config, this->HeadTarget);
if(!iface) { return; }
for(std::vector<std::string>::const_iterator
@@ -2070,12 +2069,11 @@ void processILibs(const std::string& config,
std::vector<cmTarget const*>& tgts,
std::set<cmTarget const*>& emitted)
{
- if (item.Target && emitted.insert(item.Target).second)
+ if (item.Target && emitted.insert(item.Target->Target).second)
{
- tgts.push_back(item.Target);
- cmGeneratorTarget* gt = gg->GetGeneratorTarget(item.Target);
+ tgts.push_back(item.Target->Target);
if(cmLinkInterfaceLibraries const* iface =
- gt->GetLinkInterfaceLibraries(config, headTarget, true))
+ item.Target->GetLinkInterfaceLibraries(config, headTarget, true))
{
for(std::vector<cmLinkItem>::const_iterator
it = iface->Libraries.begin();
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index 33780a7..b875cc0 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -16,7 +16,6 @@
#include "cmListFileCache.h"
class cmGeneratorTarget;
-class cmTarget;
// Basic information about each link item.
class cmLinkItem: public std::string
@@ -25,9 +24,9 @@ class cmLinkItem: public std::string
public:
cmLinkItem(): std_string(), Target(0) {}
cmLinkItem(const std_string& n,
- cmTarget const* t): std_string(n), Target(t) {}
+ cmGeneratorTarget const* t): std_string(n), Target(t) {}
cmLinkItem(cmLinkItem const& r): std_string(r), Target(r.Target) {}
- cmTarget const* Target;
+ cmGeneratorTarget const* Target;
};
class cmLinkImplItem: public cmLinkItem
@@ -35,7 +34,7 @@ class cmLinkImplItem: public cmLinkItem
public:
cmLinkImplItem(): cmLinkItem(), Backtrace(), FromGenex(false) {}
cmLinkImplItem(std::string const& n,
- cmTarget const* t,
+ cmGeneratorTarget const* t,
cmListFileBacktrace const& bt,
bool fromGenex):
cmLinkItem(n, t), Backtrace(bt), FromGenex(fromGenex) {}