summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-10-06 16:35:37 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-10-27 19:29:34 (GMT)
commit25f1df3e816b62a518206cb88f69fdb15b2eebc9 (patch)
treeea8db5e42264c0b0bcd1004818264b8ea8488c2a
parentb63c71aa35fffeef550ccf7f60382cbe794635ac (diff)
downloadCMake-25f1df3e816b62a518206cb88f69fdb15b2eebc9.zip
CMake-25f1df3e816b62a518206cb88f69fdb15b2eebc9.tar.gz
CMake-25f1df3e816b62a518206cb88f69fdb15b2eebc9.tar.bz2
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.
-rw-r--r--Source/cmGeneratorTarget.cxx2
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmGlobalGenerator.cxx26
-rw-r--r--Source/cmGlobalGenerator.h1
4 files changed, 25 insertions, 6 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 62ac263..0cc2e92 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -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();
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index dedfa60..e7e7d34 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -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&);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index e26f59f..1b0ec4d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -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;
}
@@ -1281,6 +1282,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()
{
for(cmGeneratorTargetsType::iterator i = this->GeneratorTargets.begin();
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index c930b2b..4bd1d40 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -406,6 +406,7 @@ private:
// Per-target generator information.
cmGeneratorTargetsType GeneratorTargets;
void CreateGeneratorTargets();
+ void ComputeGeneratorTargetObjects();
void ClearGeneratorTargets();
virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;