mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-20 04:24:36 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user