summaryrefslogtreecommitdiff
path: root/solenv/gcc-wrappers
diff options
context:
space:
mode:
authorPeter Foley <pefoley2@verizon.net>2013-03-16 10:18:35 -0400
committerPeter Foley <pefoley2@verizon.net>2013-03-16 14:09:28 -0400
commit2eaf9fd4e0643d348df57114def27ccea3afa665 (patch)
treeaff7bc7a103d9f7a78a6b66c4548ac1ee681aa9f /solenv/gcc-wrappers
parent82c4b9491aa9a9d20eede8184e5bd1f7b04efee4 (diff)
add support for more options to gcc-wrapper
Change-Id: If43721642f2453671e74ccda9572f873360ca65a
Diffstat (limited to 'solenv/gcc-wrappers')
-rwxr-xr-xsolenv/gcc-wrappers/g++.cxx2
-rwxr-xr-xsolenv/gcc-wrappers/gcc.cxx2
-rw-r--r--solenv/gcc-wrappers/wrapper.cxx22
3 files changed, 24 insertions, 2 deletions
diff --git a/solenv/gcc-wrappers/g++.cxx b/solenv/gcc-wrappers/g++.cxx
index d2ee3d555e0a..19106afc13ba 100755
--- a/solenv/gcc-wrappers/g++.cxx
+++ b/solenv/gcc-wrappers/g++.cxx
@@ -18,6 +18,8 @@ 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 b8983cf6e5e6..e8b15bb75795 100755
--- a/solenv/gcc-wrappers/gcc.cxx
+++ b/solenv/gcc-wrappers/gcc.cxx
@@ -18,6 +18,8 @@ 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 4976305c4d3d..7a4fb9164367 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -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);