diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 5604c5331..22843f170 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 e53b7b9d3..8f3def207 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -319,22 +319,20 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index, std::set &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 configs; depender->Makefile->GetConfigurations(configs); for (std::vector::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::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 78a5b6f78..7e4726199 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 + "$ const& cmGeneratorTarget::GetUtilityItems() const for(std::set::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::const_iterator @@ -2070,12 +2069,11 @@ void processILibs(const std::string& config, std::vector& tgts, std::set& 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::const_iterator it = iface->Libraries.begin(); diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index 33780a73f..b875cc03d 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) {}