summaryrefslogtreecommitdiff
path: root/solenv/gcc-wrappers
diff options
context:
space:
mode:
authorPeter Foley <pefoley2@verizon.net>2013-03-23 09:30:52 -0400
committerPeter Foley <pefoley2@verizon.net>2013-03-23 11:45:35 -0400
commit28fb57daa77438f5e63132d3417062a11a44461e (patch)
tree68eee5fbf493d23fcaccf1394dde0095cf55e4ef /solenv/gcc-wrappers
parentc52ceef8395a3b4c59bf6e139e126b57c77d2d92 (diff)
make gcc-wrapper work with ccache
Change-Id: I4db04d8ce04c928b67d86172fcbe33adacbd85d8
Diffstat (limited to 'solenv/gcc-wrappers')
-rw-r--r--solenv/gcc-wrappers/g++.cxx2
-rw-r--r--solenv/gcc-wrappers/gcc.cxx2
-rw-r--r--solenv/gcc-wrappers/wrapper.cxx11
3 files changed, 11 insertions, 4 deletions
diff --git a/solenv/gcc-wrappers/g++.cxx b/solenv/gcc-wrappers/g++.cxx
index 19106afc13ba..d2ee3d555e0a 100644
--- a/solenv/gcc-wrappers/g++.cxx
+++ b/solenv/gcc-wrappers/g++.cxx
@@ -18,8 +18,6 @@ int main(int argc, char *argv[]) {
setupccenv();
- cerr << "CXX= " << command << " " << args << endl;
-
return startprocess(command,args);
}
diff --git a/solenv/gcc-wrappers/gcc.cxx b/solenv/gcc-wrappers/gcc.cxx
index e8b15bb75795..b8983cf6e5e6 100644
--- a/solenv/gcc-wrappers/gcc.cxx
+++ b/solenv/gcc-wrappers/gcc.cxx
@@ -18,8 +18,6 @@ int main(int argc, char *argv[]) {
setupccenv();
- cerr << "CC= " << command << " " << args << endl;
-
return startprocess(command,args);
}
diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index 7a4fb9164367..2b2f2338733f 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -9,6 +9,8 @@
#include "wrapper.hxx"
+#define WIN32_LEAN_AND_MEAN
+
#include <windows.h>
#define BUFLEN 2048
@@ -139,6 +141,14 @@ int startprocess(string command, string args) {
si.hStdOutput=childout_write;
si.hStdError=childout_write;
+ size_t pos=command.find("ccache ");
+ if(pos != string::npos) {
+ args.insert(0,"cl.exe");
+ command=command.substr(0,pos+strlen("ccache"))+".exe";
+ }
+
+ //cerr << "CMD= " << command << " " << args << endl;
+
// Commandline may be modified by CreateProcess
char* cmdline=_strdup(args.c_str());
@@ -177,6 +187,7 @@ int startprocess(string command, string args) {
WriteFile(stdout_handle,buffer,readlen,&writelen,NULL);
}
}
+ WaitForSingleObject(pi.hProcess, INFINITE);
GetExitCodeProcess(pi.hProcess, &ret);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);