mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 13:51:33 -06:00
Merge topic 'target-sources-refactor'
5de63265Genex: Only evaluate TARGET_OBJECTS to determine target sources.aa0a3562cmGeneratorTarget: Compute target objects on demand042c1c83cmTarget: Compute languages from object libraries on demand.fdcefe3ccmGeneratorTarget: Compute consumed object libraries on demand.c355d108cmComputeTargetDepends: Track object library depends.e5da9e51cmTarget: Allow any generator expression in SOURCES property.5702e106cmTarget: Include TARGET_OBJECTS genex in target SOURCES property.857d30b5cmGlobalGenerator: Add interface to call ForceLinkerLanguages28e1d2f8cmStringCommand: Add GENEX_STRIP subcommand.bf98cc25Genex: Evaluate TARGET_OBJECTS as a normal expression.8cd113adcmTarget: Store strings instead of cmSourceFile* to represent SOURCES.4959f341cmSourceFileLocation: Collapse full path for directory comparisons.fcc92878cmSourceFileLocation: Remove unused Update method.59e8740acmTarget: Remove AddSourceFile method26d494bacmTarget: Use string API to add sources to cmTarget objects.d38423eccmTarget: Add a method to obtain list of filenames for sources. ...
This commit is contained in:
@@ -216,6 +216,11 @@ bool cmGlobalGenerator::GenerateImportFile(const std::string &file)
|
||||
return false;
|
||||
}
|
||||
|
||||
void cmGlobalGenerator::ForceLinkerLanguages()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
cmGlobalGenerator::IsExportedTargetsFile(const std::string &filename) const
|
||||
{
|
||||
@@ -1196,6 +1201,8 @@ void cmGlobalGenerator::Generate()
|
||||
// Create per-target generator information.
|
||||
this->CreateGeneratorTargets();
|
||||
|
||||
this->ForceLinkerLanguages();
|
||||
|
||||
#ifdef CMAKE_BUILD_WITH_CMAKE
|
||||
for (AutogensType::iterator it = autogens.begin(); it != autogens.end();
|
||||
++it)
|
||||
@@ -1217,8 +1224,6 @@ void cmGlobalGenerator::Generate()
|
||||
this->LocalGenerators[i]->GenerateTargetManifest();
|
||||
}
|
||||
|
||||
this->ComputeGeneratorTargetObjects();
|
||||
|
||||
this->ProcessEvaluationFiles();
|
||||
|
||||
// Compute the inter-target dependencies.
|
||||
@@ -1409,6 +1414,7 @@ void cmGlobalGenerator::CreateGeneratorTargets(cmMakefile *mf)
|
||||
{
|
||||
cmTarget* t = &ti->second;
|
||||
cmGeneratorTarget* gt = new cmGeneratorTarget(t);
|
||||
this->ComputeTargetObjectDirectory(gt);
|
||||
this->GeneratorTargets[t] = gt;
|
||||
generatorTargets[t] = gt;
|
||||
}
|
||||
@@ -1434,29 +1440,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->ComputeTargetObjectDirectory(gt);
|
||||
gt->LookupObjectLibraries();
|
||||
this->ComputeTargetObjects(gt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmGlobalGenerator::ClearGeneratorMembers()
|
||||
@@ -1517,29 +1500,6 @@ cmGlobalGenerator::GetGeneratorTarget(cmTarget const* t) const
|
||||
return ti->second;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user