diff options
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9a6c93cc9e..e4f26d1fe0 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3492,9 +3492,9 @@ public: Makefile(target->GetMakefile()), Target(target) { this->Visited.insert(target); } - void Visit(const std::string& name) + void Visit(cmTarget const* from, const std::string& name) { - cmTarget *target = this->Makefile->FindTargetToUse(name); + cmTarget const *target = from->FindTargetToLink(name); if(!target) { @@ -3553,7 +3553,7 @@ public: for(std::vector<std::string>::const_iterator li = iface->Libraries.begin(); li != iface->Libraries.end(); ++li) { - this->Visit(*li); + this->Visit(target, *li); } } private: @@ -3659,7 +3659,7 @@ void cmTarget::ComputeLinkClosure(const std::string& config, for(std::vector<std::string>::const_iterator li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li) { - cll.Visit(*li); + cll.Visit(this, *li); } // Store the transitive closure of languages. @@ -6149,13 +6149,12 @@ cmTarget::GetImportLinkInterface(const std::string& config, //---------------------------------------------------------------------------- void processILibs(const std::string& config, cmTarget const* headTarget, + cmTarget const* curTarget, std::string const& name, std::vector<cmTarget const*>& tgts, std::set<cmTarget const*>& emitted) { - cmTarget* tgt = headTarget->GetMakefile() - ->FindTargetToUse(name); - if (tgt && emitted.insert(tgt).second) + if (cmTarget const* tgt = curTarget->FindTargetToLink(name)) { tgts.push_back(tgt); if(cmTarget::LinkInterface const* iface = @@ -6165,7 +6164,7 @@ void processILibs(const std::string& config, it = iface->Libraries.begin(); it != iface->Libraries.end(); ++it) { - processILibs(config, headTarget, *it, tgts, emitted); + processILibs(config, headTarget, tgt, *it, tgts, emitted); } } } @@ -6188,7 +6187,7 @@ cmTarget::GetLinkImplementationClosure(const std::string& config) const for(std::vector<std::string>::const_iterator it = impl->Libraries.begin(); it != impl->Libraries.end(); ++it) { - processILibs(config, this, *it, tgts , emitted); + processILibs(config, this, this, *it, tgts , emitted); } } return tgts; @@ -6212,8 +6211,7 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config, for(std::vector<std::string>::const_iterator it = iface->Libraries.begin(); it != iface->Libraries.end(); ++it) { - if (cmTarget const* tgt = headTarget->GetMakefile() - ->FindTargetToUse(*it)) + if (cmTarget const* tgt = this->FindTargetToLink(*it)) { tgts.push_back(tgt); } @@ -6245,8 +6243,7 @@ void cmTarget::GetTransitivePropertyTargets(const std::string& config, for(std::vector<std::string>::const_iterator it = libs.begin(); it != libs.end(); ++it) { - if (cmTarget* tgt = headTarget->GetMakefile() - ->FindTargetToUse(*it)) + if (cmTarget const* tgt = this->FindTargetToLink(*it)) { tgts.push_back(tgt); } |