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
1 changed files with 5 additions and 1 deletions

View File

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