From fcedf8e5528d711f1e4b765809da018d5adb2abd Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 30 May 2019 13:47:26 -0400 Subject: VS: Isolate custom command input/output generation scopes --- Source/cmVisualStudio10TargetGenerator.cxx | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 7736e59..3f0d41d 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1354,22 +1354,26 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule( std::string script = lg->ConstructScript(ccg); // input files for custom command std::stringstream inputs; - inputs << source->GetFullPath(); - for (std::string const& d : ccg.GetDepends()) { - std::string dep; - if (lg->GetRealDependency(d, c, dep)) { - ConvertToWindowsSlash(dep); - inputs << ";" << dep; + { + inputs << source->GetFullPath(); + for (std::string const& d : ccg.GetDepends()) { + std::string dep; + if (lg->GetRealDependency(d, c, dep)) { + ConvertToWindowsSlash(dep); + inputs << ";" << dep; + } } } // output files for custom command std::stringstream outputs; - const char* sep = ""; - for (std::string const& o : ccg.GetOutputs()) { - std::string out = o; - ConvertToWindowsSlash(out); - outputs << sep << out; - sep = ";"; + { + const char* sep = ""; + for (std::string const& o : ccg.GetOutputs()) { + std::string out = o; + ConvertToWindowsSlash(out); + outputs << sep << out; + sep = ";"; + } } if (this->ProjectType == csproj) { std::string name = "CustomCommand_" + c + "_" + -- cgit v0.12