From 998d9ee967f6795c71ff23cf16601f7e974b21ba Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 27 Aug 2016 13:44:54 +0200 Subject: [PATCH] VS: Replace variable with an if() --- Source/cmLocalVisualStudioGenerator.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index bdb1c2b87..ca006b707 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -127,7 +127,6 @@ std::string cmLocalVisualStudioGenerator::ConstructScript( { bool useLocal = this->CustomCommandUseLocal(); std::string workingDirectory = ccg.GetWorkingDirectory(); - RelativeRoot relativeRoot = workingDirectory.empty() ? START_OUTPUT : NONE; // Avoid leading or trailing newlines. std::string newline = ""; @@ -203,7 +202,11 @@ std::string cmLocalVisualStudioGenerator::ConstructScript( } } - script += this->Convert(cmd.c_str(), relativeRoot, SHELL); + if (workingDirectory.empty()) { + script += this->Convert(cmd.c_str(), START_OUTPUT, SHELL); + } else { + script += this->Convert(cmd.c_str(), NONE, SHELL); + } ccg.AppendArguments(c, script); // After each custom command, check for an error result.