Commit 25f1df3e authored by Stephen Kelly's avatar Stephen Kelly
Browse files

Split CreateGeneratorTargets into two methods.

As the generate-time-related API is moving to cmGeneratorTarget, almost
all of generation code needs to be able to access instances of it.
parent b63c71aa
......@@ -25,8 +25,6 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
this->Makefile = this->Target->GetMakefile();
this->LocalGenerator = this->Makefile->GetLocalGenerator();
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
this->ClassifySources();
this->LookupObjectLibraries();
}
//----------------------------------------------------------------------------
......
......@@ -74,10 +74,10 @@ public:
bool IsSystemIncludeDirectory(const char *dir, const char *config);
private:
void ClassifySources();
void LookupObjectLibraries();
private:
std::map<std::string, std::vector<std::string> > SystemIncludesCache;
cmGeneratorTarget(cmGeneratorTarget const&);
......
......@@ -1058,6 +1058,9 @@ void cmGlobalGenerator::Generate()
this->LocalGenerators[i]->AddHelperCommands();
}
// Create per-target generator information.
this->CreateGeneratorTargets();
// Trace the dependencies, after that no custom commands should be added
// because their dependencies might not be handled correctly
for (i = 0; i < this->LocalGenerators.size(); ++i)
......@@ -1071,8 +1074,7 @@ void cmGlobalGenerator::Generate()
this->LocalGenerators[i]->GenerateTargetManifest();
}
// Create per-target generator information.
this->CreateGeneratorTargets();
this->ComputeGeneratorTargetObjects();
this->ProcessEvaluationFiles();
......@@ -1263,7 +1265,6 @@ void cmGlobalGenerator::CreateGeneratorTargets()
cmGeneratorTarget* gt = new cmGeneratorTarget(t);
this->GeneratorTargets[t] = gt;
this->ComputeTargetObjects(gt);
generatorTargets[t] = gt;
}
......@@ -1280,6 +1281,25 @@ void cmGlobalGenerator::CreateGeneratorTargets()
}
}
//----------------------------------------------------------------------------
void cmGlobalGenerator::ComputeGeneratorTargetObjects()
{
// Construct per-target generator information.
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
cmMakefile *mf = this->LocalGenerators[i]->GetMakefile();
cmGeneratorTargetsType targets = mf->GetGeneratorTargets();
for(cmGeneratorTargetsType::iterator ti = targets.begin();
ti != targets.end(); ++ti)
{
cmGeneratorTarget* gt = ti->second;
gt->ClassifySources();
gt->LookupObjectLibraries();
this->ComputeTargetObjects(gt);
}
}
}
//----------------------------------------------------------------------------
void cmGlobalGenerator::ClearGeneratorTargets()
{
......
......@@ -406,6 +406,7 @@ private:
// Per-target generator information.
cmGeneratorTargetsType GeneratorTargets;
void CreateGeneratorTargets();
void ComputeGeneratorTargetObjects();
void ClearGeneratorTargets();
virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment