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
This commit is contained in:
Stephan Bergmann 2015-12-01 11:39:04 +01:00
parent 895061b809
commit 2291cadabf

View File

@ -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