summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-12-01 11:39:04 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-12-02 08:02:24 +0100
commit2291cadabfe2ddfeddabce7f0ae49a3e9e7ca20d (patch)
tree442f84797aab3b58d2422c2e54a7f64cac2dab70 /solenv
parent895061b809e443e24896b1c851a7d4dafb045a68 (diff)
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
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gcc-wrappers/wrapper.cxx11
1 files changed, 4 insertions, 7 deletions
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