summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-10 13:23:39 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-05-10 13:23:43 (GMT)
commit8a19ce47679580445a5ae291ecfbb3e88c8c6aeb (patch)
treeaea676017eab28307240fb146230da0ff1a578e8 /Source
parent53f1f55599808bf9771a32df35ac4d7a83f4007b (diff)
parent5e0e03d953c03e1703708f4f579d903990edecb9 (diff)
downloadCMake-8a19ce47679580445a5ae291ecfbb3e88c8c6aeb.zip
CMake-8a19ce47679580445a5ae291ecfbb3e88c8c6aeb.tar.gz
CMake-8a19ce47679580445a5ae291ecfbb3e88c8c6aeb.tar.bz2
Merge topic 'ninja-windows-command-concat'
5e0e03d9 Ninja: Fix command concatenation on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !801
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index e0e3e54..124bd80 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -322,7 +322,13 @@ std::string cmLocalNinjaGenerator::BuildCommandLine(
} else if (cmdLines.size() > 1) {
cmd << "cmd.exe /C \"";
}
- cmd << *li;
+ // Put current cmdLine in brackets if it contains "||" because it has
+ // higher precedence than "&&" in cmd.exe
+ if (li->find("||") != std::string::npos) {
+ cmd << "( " << *li << " )";
+ } else {
+ cmd << *li;
+ }
}
if (cmdLines.size() > 1) {
cmd << "\"";