VS: Port LinkClosure to cmGeneratorTarget

This commit is contained in:
Stephen Kelly 2015-10-23 18:26:39 +02:00
parent 26e23e8463
commit ce9e9a92cf
2 changed files with 13 additions and 12 deletions

View File

@ -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.

View File

@ -146,8 +146,8 @@ private:
class TargetSetMap: public std::map<cmTarget*, TargetSet> {};
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: