Kaydet (Commit) 28fb57da authored tarafından Peter Foley's avatar Peter Foley

make gcc-wrapper work with ccache

Change-Id: I4db04d8ce04c928b67d86172fcbe33adacbd85d8
üst c52ceef8
...@@ -560,9 +560,9 @@ endef ...@@ -560,9 +560,9 @@ endef
# /opt/lo/bin/ccache /cygdrive/c/PROGRA~2/MICROS~2.0/VC/bin/cl.exe # /opt/lo/bin/ccache /cygdrive/c/PROGRA~2/MICROS~2.0/VC/bin/cl.exe
gb_AUTOCONF_WRAPPERS := \ gb_AUTOCONF_WRAPPERS := \
REAL_CC="$(shell cygpath -w $(lastword $(CC)))" \ REAL_CC="$(shell cygpath -w $(CC))" \
CC="$(call gb_Executable_get_target,gcc-wrapper)" \ CC="$(call gb_Executable_get_target,gcc-wrapper)" \
REAL_CXX="$(shell cygpath -w $(lastword $(CXX)))" \ REAL_CXX="$(shell cygpath -w $(CXX))" \
CXX="$(call gb_Executable_get_target,g++-wrapper)" \ CXX="$(call gb_Executable_get_target,g++-wrapper)" \
LD="$(shell cygpath -w $(COMPATH)/bin/link.exe) -nologo" LD="$(shell cygpath -w $(COMPATH)/bin/link.exe) -nologo"
......
...@@ -18,8 +18,6 @@ int main(int argc, char *argv[]) { ...@@ -18,8 +18,6 @@ int main(int argc, char *argv[]) {
setupccenv(); setupccenv();
cerr << "CXX= " << command << " " << args << endl;
return startprocess(command,args); return startprocess(command,args);
} }
......
...@@ -18,8 +18,6 @@ int main(int argc, char *argv[]) { ...@@ -18,8 +18,6 @@ int main(int argc, char *argv[]) {
setupccenv(); setupccenv();
cerr << "CC= " << command << " " << args << endl;
return startprocess(command,args); return startprocess(command,args);
} }
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include "wrapper.hxx" #include "wrapper.hxx"
#define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#define BUFLEN 2048 #define BUFLEN 2048
...@@ -139,6 +141,14 @@ int startprocess(string command, string args) { ...@@ -139,6 +141,14 @@ int startprocess(string command, string args) {
si.hStdOutput=childout_write; si.hStdOutput=childout_write;
si.hStdError=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 // Commandline may be modified by CreateProcess
char* cmdline=_strdup(args.c_str()); char* cmdline=_strdup(args.c_str());
...@@ -177,6 +187,7 @@ int startprocess(string command, string args) { ...@@ -177,6 +187,7 @@ int startprocess(string command, string args) {
WriteFile(stdout_handle,buffer,readlen,&writelen,NULL); WriteFile(stdout_handle,buffer,readlen,&writelen,NULL);
} }
} }
WaitForSingleObject(pi.hProcess, INFINITE);
GetExitCodeProcess(pi.hProcess, &ret); GetExitCodeProcess(pi.hProcess, &ret);
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment