diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2013-02-20 16:38:25 +0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2013-02-21 08:50:49 +0700 |
commit | 21f7959f64db7f3309e7f9d0d106abb1ea82f403 (patch) | |
tree | 987d9eea6fe4a9afe56613673f7fb9cb118a5ed8 /emcc | |
parent | b63fde6a7fe863c6f3448e2b63d3e17eb9bb0d83 (diff) |
emcc: Improve handling of -O flag.
Previously, while gcc supports -O, emcc would fail. It now interprets
-O as -O2, just as gcc does.
Additionally, it was only looking at the first character after -O, so
nonsense like -O34 would be accepted (and treated as -O3).
Diffstat (limited to 'emcc')
-rwxr-xr-x | emcc | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -616,7 +616,8 @@ try: for i in range(len(newargs)): newargs[i] = newargs[i].strip() # On Windows Vista (and possibly others), excessive spaces in the command line leak into the items in this array, so trim e.g. 'foo.cpp ' -> 'foo.cpp' if newargs[i].startswith('-O'): - requested_level = newargs[i][2] + # Let -O default to -O2, which is what gcc does. + requested_level = newargs[i][2:] or '2' if requested_level == 's': print >> sys.stderr, 'emcc: warning: -Os is ignored (use -O0, -O1, -O2)' else: |