From df753df94bb1e995372baabb0240585560c72ded Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 27 Mar 2014 17:06:34 +0100 Subject: [PATCH] cmGeneratorTarget: Don't add computed sources to the target. When config-specifig generator expressions are supported, a target may have SOURCES: src1.cpp $<$:src2.cpp> $<$: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. --- Source/cmGeneratorTarget.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 321dd42c5..8688f78a3 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -619,7 +619,11 @@ cmTargetTraceDependencies for(std::vector::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); + } } }