From 2291cadabfe2ddfeddabce7f0ae49a3e9e7ca20d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 1 Dec 2015 11:39:04 +0100 Subject: For some odd reason, clang-cl.exe doesn't like being called by CreateProcess ...with the executable specified in the first arg, instead of as part of the second arg (i.e., the command line) Change-Id: Ie6e232f6880b5bfbb91a52ee5398b91a0ccddc4d --- solenv/gcc-wrappers/wrapper.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'solenv/gcc-wrappers') diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx index 60e61594305a..0ed323c3af5e 100644 --- a/solenv/gcc-wrappers/wrapper.cxx +++ b/solenv/gcc-wrappers/wrapper.cxx @@ -194,18 +194,15 @@ int startprocess(string command, string args) { command=command.substr(0,pos+strlen("ccache"))+".exe"; } - if (args[0] != ' ') - { - args.insert(0, " "); // lpCommandLine *must* start with space! - } + auto cmdline = "\"" + command + "\" " + args; //cerr << "CMD= " << command << " " << args << endl; // Commandline may be modified by CreateProcess - char* cmdline=_strdup(args.c_str()); + char* cmdlineBuf=_strdup(cmdline.c_str()); - if(!CreateProcess(command.c_str(), // Process Name - cmdline, // Command Line + if(!CreateProcess(nullptr, // Process Name + cmdlineBuf, // Command Line NULL, // Process Handle not Inheritable NULL, // Thread Handle not Inheritable TRUE, // Handles are Inherited -- cgit