cmGeneratorTarget: Port object library handling to cmGeneratorTarget.

This commit is contained in:
Stephen Kelly 2015-10-16 19:19:48 +02:00
parent 393654bf49
commit 8aaed08696
1 changed files with 6 additions and 7 deletions

View File

@ -2004,27 +2004,26 @@ cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs,
{
std::vector<cmSourceFile const*> objectFiles;
this->GetExternalObjects(objectFiles, config);
std::vector<cmTarget*> objectLibraries;
std::vector<cmGeneratorTarget*> objectLibraries;
for(std::vector<cmSourceFile const*>::const_iterator
it = objectFiles.begin(); it != objectFiles.end(); ++it)
{
std::string objLib = (*it)->GetObjectLibrary();
if (cmTarget* tgt = this->Makefile->FindTargetToUse(objLib))
if (cmGeneratorTarget* tgt =
this->LocalGenerator->FindGeneratorTargetToUse(objLib))
{
objectLibraries.push_back(tgt);
}
}
std::vector<cmTarget*>::const_iterator end
std::vector<cmGeneratorTarget*>::const_iterator end
= cmRemoveDuplicates(objectLibraries);
for(std::vector<cmTarget*>::const_iterator
for(std::vector<cmGeneratorTarget*>::const_iterator
ti = objectLibraries.begin();
ti != end; ++ti)
{
cmTarget* objLib = *ti;
cmGeneratorTarget* ogt =
this->GlobalGenerator->GetGeneratorTarget(objLib);
cmGeneratorTarget* ogt = *ti;
std::vector<cmSourceFile const*> objectSources;
ogt->GetObjectSources(objectSources, config);
for(std::vector<cmSourceFile const*>::const_iterator