summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 4b0604c..bc3da6e 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -14,6 +14,8 @@
#include "cmsys/FStream.hxx"
+#include "cm_codecvt_Encoding.hxx"
+
#include "cmCryptoHash.h"
#include "cmCustomCommand.h"
#include "cmCustomCommandGenerator.h"
@@ -536,13 +538,14 @@ std::string cmLocalNinjaGenerator::BuildCommandLine(
std::ostringstream cmd;
#ifdef _WIN32
+ cmGlobalNinjaGenerator const* gg = this->GetGlobalNinjaGenerator();
bool const needCMD =
cmdLines.size() > 1 || (customStep.empty() && RuleNeedsCMD(cmdLines[0]));
for (auto li = cmdLines.begin(); li != cmdLines.end(); ++li) {
if (li != cmdLines.begin()) {
cmd << " && ";
} else if (needCMD) {
- cmd << "cmd.exe /C \"";
+ cmd << gg->GetComspec() << " /C \"";
}
// Put current cmdLine in brackets if it contains "||" because it has
// higher precedence than "&&" in cmd.exe