summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-27 16:06:34 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-02 21:14:02 (GMT)
commitdf753df94bb1e995372baabb0240585560c72ded (patch)
tree0dfeb552caccda9df68ec32e4f308fada323736f
parent869328aac31f8e702ac7039ce72c6fa485432733 (diff)
downloadCMake-df753df94bb1e995372baabb0240585560c72ded.zip
CMake-df753df94bb1e995372baabb0240585560c72ded.tar.gz
CMake-df753df94bb1e995372baabb0240585560c72ded.tar.bz2
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.
-rw-r--r--Source/cmGeneratorTarget.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 321dd42..8688f78 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -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);
+ }
}
}