diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-10-23 16:26:48 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-24 07:24:43 (GMT) |
commit | 6cac952b9ed8ad202286ddee7246d9ef7ed8f22d (patch) | |
tree | 50a60557bee9ca3bb9179cb14ad3afbfe5df658b /Source/cmGlobalVisualStudioGenerator.cxx | |
parent | 97b3768898431ffff824388dc263654a35a33aa2 (diff) | |
download | CMake-6cac952b9ed8ad202286ddee7246d9ef7ed8f22d.zip CMake-6cac952b9ed8ad202286ddee7246d9ef7ed8f22d.tar.gz CMake-6cac952b9ed8ad202286ddee7246d9ef7ed8f22d.tar.bz2 |
VS: Port interface to cmGeneratorTarget
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 0ba0ccb..b819dad 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -307,7 +307,7 @@ void cmGlobalVisualStudioGenerator::FillLinkClosure( const cmGeneratorTarget *target, TargetSet& linked) { - if(linked.insert(target->Target).second) + if(linked.insert(target).second) { TargetDependSet const& depends = this->GetTargetDirectDepends(target); @@ -326,10 +326,10 @@ void cmGlobalVisualStudioGenerator::FillLinkClosure( cmGlobalVisualStudioGenerator::TargetSet const& cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmGeneratorTarget* target) { - TargetSetMap::iterator i = this->TargetLinkClosure.find(target->Target); + TargetSetMap::iterator i = this->TargetLinkClosure.find(target); if(i == this->TargetLinkClosure.end()) { - TargetSetMap::value_type entry(target->Target, TargetSet()); + TargetSetMap::value_type entry(target, TargetSet()); i = this->TargetLinkClosure.insert(entry).first; this->FillLinkClosure(target, i->second); } @@ -338,7 +338,8 @@ cmGlobalVisualStudioGenerator::GetTargetLinkClosure(cmGeneratorTarget* target) //---------------------------------------------------------------------------- void cmGlobalVisualStudioGenerator::FollowLinkDepends( - cmTarget const* target, std::set<cmTarget const*>& linked) + const cmGeneratorTarget *target, + std::set<const cmGeneratorTarget *> &linked) { if(target->GetType() == cmState::INTERFACE_LIBRARY) { @@ -349,14 +350,13 @@ void cmGlobalVisualStudioGenerator::FollowLinkDepends( { // Static library targets do not list their link dependencies so // we must follow them transitively now. - 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->FollowLinkDepends((*di)->Target, linked); + this->FollowLinkDepends(*di, linked); } } } @@ -431,7 +431,7 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( // Collect implicit link dependencies (target_link_libraries). // Static libraries cannot depend on their link implementation // due to behavior (2), but they do not really need to. - std::set<cmTarget const*> linkDepends; + std::set<cmGeneratorTarget const*> linkDepends; if(target->GetType() != cmState::STATIC_LIBRARY) { for(TargetDependSet::const_iterator di = depends.begin(); @@ -440,20 +440,20 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( cmTargetDepend dep = *di; if(dep.IsLink()) { - this->FollowLinkDepends(dep->Target, linkDepends); + this->FollowLinkDepends(*di, linkDepends); } } } // Collect explicit util dependencies (add_dependencies). - std::set<cmTarget const*> utilDepends; + std::set<cmGeneratorTarget const*> utilDepends; for(TargetDependSet::const_iterator di = depends.begin(); di != depends.end(); ++di) { cmTargetDepend dep = *di; if(dep.IsUtil()) { - this->FollowLinkDepends(dep->Target, utilDepends); + this->FollowLinkDepends(*di, utilDepends); } } @@ -466,23 +466,22 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends( } // Emit link dependencies. - for(std::set<cmTarget const*>::iterator di = linkDepends.begin(); + for(std::set<cmGeneratorTarget const*>::iterator di = linkDepends.begin(); di != linkDepends.end(); ++di) { - cmTarget const* dep = *di; + cmGeneratorTarget const* dep = *di; vsTargetDepend.insert(dep->GetName()); } // Emit util dependencies. Possibly use intermediate targets. - for(std::set<cmTarget const*>::iterator di = utilDepends.begin(); + for(std::set<cmGeneratorTarget const*>::iterator di = utilDepends.begin(); di != utilDepends.end(); ++di) { - cmTarget const* dep = *di; - cmGeneratorTarget* dgt = this->GetGeneratorTarget(dep); - if(allowLinkable || !VSLinkable(dgt) || linked.count(dep)) + cmGeneratorTarget const* dgt = *di; + if(allowLinkable || !VSLinkable(dgt) || linked.count(dgt)) { // Direct dependency allowed. - vsTargetDepend.insert(dep->GetName()); + vsTargetDepend.insert(dgt->GetName()); } else { @@ -892,9 +891,7 @@ cmGlobalVisualStudioGenerator::OrderedTargetDependSet for (TargetSet::const_iterator it = targets.begin(); it != targets.end(); ++it) { - cmGeneratorTarget* gt = - (*it)->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(*it); - this->insert(gt); + this->insert(*it); } } |