summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-14 12:21:26 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-02 21:12:57 (GMT)
commitaa0a3562dd47bdd6d9ca3058bd1dfd525e79d36d (patch)
treedc08a5a7988c2f941b50347ffd03eb48eeec2544 /Source/cmGlobalGenerator.cxx
parent042c1c834e69ee60b605b02bad8be87b2193a7d2 (diff)
downloadCMake-aa0a3562dd47bdd6d9ca3058bd1dfd525e79d36d.zip
CMake-aa0a3562dd47bdd6d9ca3058bd1dfd525e79d36d.tar.gz
CMake-aa0a3562dd47bdd6d9ca3058bd1dfd525e79d36d.tar.bz2
cmGeneratorTarget: Compute target objects on demand
Add a ComputeObjectMapping method to compute the object names. It takes mapping to populate as an out-parameter so that it can be extended in the future with parameters relevant to generator expression evaluation. Remove the supporting cmGeneratorTarget::AddObject method. It is no longer needed as the container member is populated directly. The ComputeObjectMapping method is called whenever objects are requested from the cmGeneratorTarget. Because the Xcode generator makes no such request, explicitly invoke the method from that generator so that the logic of checking for bad sources in object libraries is executed. In a follow-up, the UseObjectLibraries usage may be replaced by a true generator expression evaluator for TARGET_OBJECTS. That will require generators to use cmGeneratorTarget::GetExternalObjects which is not currently the case for Xcode and VS generators.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx46
1 files changed, 0 insertions, 46 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 6caaee3..66ccf39 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1222,8 +1222,6 @@ void cmGlobalGenerator::Generate()
this->LocalGenerators[i]->GenerateTargetManifest();
}
- this->ComputeGeneratorTargetObjects();
-
this->ProcessEvaluationFiles();
// Compute the inter-target dependencies.
@@ -1440,27 +1438,6 @@ 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)
- {
- if (ti->second->Target->IsImported()
- || ti->second->Target->GetType() == cmTarget::INTERFACE_LIBRARY)
- {
- continue;
- }
- cmGeneratorTarget* gt = ti->second;
- this->ComputeTargetObjects(gt);
- }
- }
-}
//----------------------------------------------------------------------------
void cmGlobalGenerator::ClearGeneratorMembers()
@@ -1522,29 +1499,6 @@ cmGlobalGenerator::GetGeneratorTarget(cmTarget const* t) const
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const
-{
- std::vector<cmSourceFile const*> objectSources;
- gt->GetObjectSources(objectSources);
-
- std::map<cmSourceFile const*, std::string> mapping;
- for(std::vector<cmSourceFile const*>::const_iterator it
- = objectSources.begin(); it != objectSources.end(); ++it)
- {
- mapping[*it];
- }
-
- gt->LocalGenerator->ComputeObjectFilenames(mapping, gt);
-
- for(std::map<cmSourceFile const*, std::string>::const_iterator it
- = mapping.begin(); it != mapping.end(); ++it)
- {
- assert(!it->second.empty());
- gt->AddObject(it->first, it->second);
- }
-}
-
-//----------------------------------------------------------------------------
void cmGlobalGenerator::ComputeTargetObjectDirectory(cmGeneratorTarget*) const
{
}