Do not populate SourceEntries in AddSourceFile.

It only generates a default constructed SourceEntry for each
cmSourceFile.

  this->Internal->SourceEntries[sf];

in cmTargetTraceDependencies::Trace has the same effect, and is called
early in generation-time for each source file anyway.
This commit is contained in:
Stephen Kelly 2012-09-15 20:46:51 +02:00
parent 638843af98
commit fa03777626
1 changed files with 2 additions and 4 deletions

View File

@ -799,12 +799,10 @@ std::vector<cmSourceFile*> const& cmTarget::GetSourceFiles()
void cmTarget::AddSourceFile(cmSourceFile* sf)
{
typedef cmTargetInternals::SourceEntriesType SourceEntriesType;
SourceEntriesType::iterator i = this->Internal->SourceEntries.find(sf);
if(i == this->Internal->SourceEntries.end())
if (std::find(this->SourceFiles.begin(), this->SourceFiles.end(), sf)
== this->SourceFiles.end())
{
typedef cmTargetInternals::SourceEntry SourceEntry;
SourceEntriesType::value_type entry(sf, SourceEntry());
i = this->Internal->SourceEntries.insert(entry).first;
this->SourceFiles.push_back(sf);
}
}