Kaydet (Commit) 2eaf9fd4 authored tarafından Peter Foley's avatar Peter Foley

add support for more options to gcc-wrapper

Change-Id: If43721642f2453671e74ccda9572f873360ca65a
üst 82c4b949
......@@ -18,6 +18,8 @@ int main(int argc, char *argv[]) {
setupccenv();
cerr << "CXX= " << command << " " << args << endl;
return startprocess(command,args);
}
......
......@@ -18,6 +18,8 @@ int main(int argc, char *argv[]) {
setupccenv();
cerr << "CC= " << command << " " << args << endl;
return startprocess(command,args);
}
......
......@@ -71,13 +71,20 @@ string processccargs(vector<string> rawargs) {
// TODO: should these options be enabled globally?
args.append(" -EHsc");
args.append(" -MD");
args.append(" -Gy");
args.append(" -Zc:wchar_t-");
args.append(" -Ob1 -Oxs -Oy-");
for(vector<string>::iterator i = rawargs.begin(); i != rawargs.end(); ++i) {
args.append(" ");
if(*i == "-o") {
// TODO: handle more than just exe output
args.append("-Fe");
++i;
size_t dot=(*i).find_last_of(".");
if(!(*i).compare(dot+1,3,"obj"))
args.append("-Fo");
else if(!(*i).compare(dot+1,3,"exe"))
args.append("-Fe");
args.append(*i);
}
else if(*i == "-g")
......@@ -90,6 +97,17 @@ string processccargs(vector<string> rawargs) {
}
args.append(*i);
}
else if(!(*i).compare(0,2,"-L")) {
args.append("-link -LIBPATH:"+(*i).substr(2));
}
else if(!(*i).compare(0,2,"-l")) {
args.append((*i).substr(2)+"lib.lib");
}
else if(!(*i).compare(0,12,"-fvisibility")) {
//TODO: drop other gcc-specific options
}
else if(*i == "-Werror")
args.append("-WX");
else
args.append(*i);
}
......@@ -156,7 +174,7 @@ int startprocess(string command, string args) {
exit(1);
}
if(readlen!=0) {
WriteFile(stdout_handle,buffer,readlen,&writelen,NULL);
WriteFile(stdout_handle,buffer,readlen,&writelen,NULL);
}
}
GetExitCodeProcess(pi.hProcess, &ret);
......
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