cmGeneratorTarget: Don't add computed sources to the target.

When config-specifig generator expressions are supported, a target
may have SOURCES:

 src1.cpp $<$<CONFIG:Debug>:src2.cpp> $<$<CONFIG:Release>:src3.cpp>

and computation in cmTargetTraceDependencies would add each of the
src2.cpp and src3.cpp sources back to the target without a
config-guard.  That would make the sources be used later when
generating the buildsystem, regardless of the configuration.

Avoid calling AddSource on the target with the result of the
GetSourceFiles call.
This commit is contained in:
Stephen Kelly 2014-03-27 17:06:34 +01:00
parent 869328aac3
commit df753df94b

View File

@ -619,7 +619,11 @@ cmTargetTraceDependencies
for(std::vector<std::string>::const_iterator si = sources.begin(); for(std::vector<std::string>::const_iterator si = sources.begin();
si != sources.end(); ++si) si != sources.end(); ++si)
{ {
this->QueueSource(*si); if(this->SourcesQueued.insert(*si).second)
{
this->SourceQueue.push(*si);
this->Makefile->GetOrCreateSource(*si);
}
} }
} }