From ce9e9a92cf773280de55ef6dcbec9fc2524f7b2e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 23 Oct 2015 18:26:39 +0200 Subject: [PATCH] VS: Port LinkClosure to cmGeneratorTarget --- Source/cmGlobalVisualStudioGenerator.cxx | 21 +++++++++++---------- Source/cmGlobalVisualStudioGenerator.h | 4 ++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 4d431f618..c43f884e8 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -303,19 +303,20 @@ std::string cmGlobalVisualStudioGenerator::GetUserMacrosRegKeyBase() } //---------------------------------------------------------------------------- -void cmGlobalVisualStudioGenerator::FillLinkClosure(cmTarget const* target, - TargetSet& linked) +void cmGlobalVisualStudioGenerator::FillLinkClosure( + const cmGeneratorTarget *target, + TargetSet& linked) { - if(linked.insert(target).second) + if(linked.insert(target->Target).second) { - cmGeneratorTarget* gt = this->GetGeneratorTarget(target); - TargetDependSet const& depends = this->GetTargetDirectDepends(gt); + TargetDependSet const& depends = + this->GetTargetDirectDepends(target); for(TargetDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { if(di->IsLink()) { - this->FillLinkClosure((*di)->Target, linked); + this->FillLinkClosure(*di, linked); } } } @@ -323,12 +324,12 @@ void cmGlobalVisualStudioGenerator::FillLinkClosure(cmTarget const* target, //---------------------------------------------------------------------------- cmGlobalVisualStudioGenerator::TargetSet const& -cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmTarget* target) +cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmGeneratorTarget* target) { - TargetSetMap::iterator i = this->TargetLinkClosure.find(target); + TargetSetMap::iterator i = this->TargetLinkClosure.find(target->Target); if(i == this->TargetLinkClosure.end()) { - TargetSetMap::value_type entry(target, TargetSet()); + TargetSetMap::value_type entry(target->Target, TargetSet()); i = this->TargetLinkClosure.insert(entry).first; this->FillLinkClosure(target, i->second); } @@ -461,7 +462,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target) TargetSet linked; if(target.GetType() != cmState::STATIC_LIBRARY) { - linked = this->GetTargetLinkClosure(&target); + linked = this->GetTargetLinkClosure(gt); } // Emit link dependencies. diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 41d0b8823..5ada37ee7 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -146,8 +146,8 @@ private: class TargetSetMap: public std::map {}; TargetSetMap TargetLinkClosure; - void FillLinkClosure(cmTarget const* target, TargetSet& linked); - TargetSet const& GetTargetLinkClosure(cmTarget* target); + void FillLinkClosure(cmGeneratorTarget const* target, TargetSet& linked); + TargetSet const& GetTargetLinkClosure(cmGeneratorTarget *target); }; class cmGlobalVisualStudioGenerator::OrderedTargetDependSet: