summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-30 13:47:26 -0400
committerBrad King <brad.king@kitware.com>2019-05-30 13:57:03 -0400
commitfcedf8e5528d711f1e4b765809da018d5adb2abd (patch)
treef2725258b29d9bc99ba5ffc41ca2d50bb363a75f
parentf872033d7531ed1d7d7345ff7873442ec8dbcee1 (diff)
downloadcmake-fcedf8e5528d711f1e4b765809da018d5adb2abd.tar.gz
VS: Isolate custom command input/output generation scopes
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx28
1 files changed, 16 insertions, 12 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 7736e593b7..3f0d41d493 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 + "_" +