cmGlobalGenerator: Map local generators to generator targets.

This commit is contained in:
Stephen Kelly 2015-06-06 15:24:24 +02:00
parent faec4e611d
commit d4a8a554ea
4 changed files with 13 additions and 15 deletions

View File

@ -2043,20 +2043,19 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap()
clg = clg->GetParent()) clg = clg->GetParent())
{ {
// This local generator includes the target. // This local generator includes the target.
std::set<cmTarget const*>& targetSet = std::set<cmGeneratorTarget const*>& targetSet =
this->LocalGeneratorToTargetMap[clg]; this->LocalGeneratorToTargetMap[clg];
targetSet.insert(&target); cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
targetSet.insert(gt);
// Add dependencies of the included target. An excluded // Add dependencies of the included target. An excluded
// target may still be included if it is a dependency of a // target may still be included if it is a dependency of a
// non-excluded target. // non-excluded target.
cmGeneratorTarget* gt = this->GetGeneratorTarget(&target);
TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(gt); TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(gt);
for(TargetDependSet::const_iterator ti = tgtdeps.begin(); for(TargetDependSet::const_iterator ti = tgtdeps.begin();
ti != tgtdeps.end(); ++ti) ti != tgtdeps.end(); ++ti)
{ {
cmGeneratorTarget const* ttt = *ti; targetSet.insert(*ti);
targetSet.insert(ttt->Target);
} }
} }
} }

View File

@ -406,7 +406,7 @@ protected:
cmMakefile* CurrentMakefile; cmMakefile* CurrentMakefile;
// map from project name to vector of local generators in that project // map from project name to vector of local generators in that project
std::map<std::string, std::vector<cmLocalGenerator*> > ProjectMap; std::map<std::string, std::vector<cmLocalGenerator*> > ProjectMap;
std::map<cmLocalGenerator*, std::set<cmTarget const*> > std::map<cmLocalGenerator*, std::set<cmGeneratorTarget const*> >
LocalGeneratorToTargetMap; LocalGeneratorToTargetMap;
// Set of named installation components requested by the project. // Set of named installation components requested by the project.

View File

@ -830,7 +830,7 @@ cmGlobalUnixMakefileGenerator3
cmLocalGenerator::FULL, cmLocalGenerator::FULL,
cmLocalGenerator::SHELL); cmLocalGenerator::SHELL);
// //
std::set<cmTarget const*> emitted; std::set<cmGeneratorTarget const*> emitted;
progCmd << " " progCmd << " "
<< this->CountProgressMarksInTarget(gtarget, emitted); << this->CountProgressMarksInTarget(gtarget, emitted);
commands.push_back(progCmd.str()); commands.push_back(progCmd.str());
@ -909,10 +909,10 @@ cmGlobalUnixMakefileGenerator3
size_t size_t
cmGlobalUnixMakefileGenerator3 cmGlobalUnixMakefileGenerator3
::CountProgressMarksInTarget(cmGeneratorTarget const* target, ::CountProgressMarksInTarget(cmGeneratorTarget const* target,
std::set<cmTarget const*>& emitted) std::set<cmGeneratorTarget const*>& emitted)
{ {
size_t count = 0; size_t count = 0;
if(emitted.insert(target->Target).second) if(emitted.insert(target).second)
{ {
count = this->ProgressMap[target->Target].Marks.size(); count = this->ProgressMap[target->Target].Marks.size();
TargetDependSet const& depends = this->GetTargetDirectDepends(target); TargetDependSet const& depends = this->GetTargetDirectDepends(target);
@ -935,14 +935,13 @@ cmGlobalUnixMakefileGenerator3
::CountProgressMarksInAll(cmLocalUnixMakefileGenerator3* lg) ::CountProgressMarksInAll(cmLocalUnixMakefileGenerator3* lg)
{ {
size_t count = 0; size_t count = 0;
std::set<cmTarget const*> emitted; std::set<cmGeneratorTarget const*> emitted;
std::set<cmTarget const*> const& targets std::set<cmGeneratorTarget const*> const& targets
= this->LocalGeneratorToTargetMap[lg]; = this->LocalGeneratorToTargetMap[lg];
for(std::set<cmTarget const*>::const_iterator t = targets.begin(); for(std::set<cmGeneratorTarget const*>::const_iterator t = targets.begin();
t != targets.end(); ++t) t != targets.end(); ++t)
{ {
cmGeneratorTarget* gt = this->GetGeneratorTarget(*t); count += this->CountProgressMarksInTarget(*t, emitted);
count += this->CountProgressMarksInTarget(gt, emitted);
} }
return count; return count;
} }

View File

@ -199,7 +199,7 @@ protected:
ProgressMapType ProgressMap; ProgressMapType ProgressMap;
size_t CountProgressMarksInTarget(cmGeneratorTarget const* target, size_t CountProgressMarksInTarget(cmGeneratorTarget const* target,
std::set<cmTarget const*>& emitted); std::set<cmGeneratorTarget const*>& emitted);
size_t CountProgressMarksInAll(cmLocalUnixMakefileGenerator3* lg); size_t CountProgressMarksInAll(cmLocalUnixMakefileGenerator3* lg);
cmGeneratedFileStream *CommandDatabase; cmGeneratedFileStream *CommandDatabase;