aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-12 18:07:07 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-12 18:07:07 -0800
commit7782c8cd4e7b186f0cbd5e78cf5ee4e843d82565 (patch)
tree8ba1f778ed7cda50211796cb5e7e1148cc14f832 /emcc
parent6df042a2ae8a85a47dcd39040204873bf01a360e (diff)
support for -s in emcc
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc17
1 files changed, 15 insertions, 2 deletions
diff --git a/emcc b/emcc
index 1bc61b08..b12aa4af 100755
--- a/emcc
+++ b/emcc
@@ -272,7 +272,16 @@ elif use_compiler:
except:
raise Exception('Invalid optimization level: ' + newargs[i])
newargs[i] = ''
- newargs = [ arg for arg in newargs if arg is not '' ] + CC_ADDITIONAL_ARGS
+ newargs = [ arg for arg in newargs if arg is not '' ]
+
+ settings_changes = []
+ for i in range(len(newargs)):
+ if newargs[i] == '-s':
+ settings_changes.append(newargs[i+1])
+ newargs[i] = newargs[i+1] = ''
+ newargs = [ arg for arg in newargs if arg is not '' ]
+
+ newargs += CC_ADDITIONAL_ARGS
if target is None:
# No explicit -o specified, so do the most natural thing, compile to .js
@@ -316,7 +325,11 @@ elif use_compiler:
shared.Settings.DISABLE_EXCEPTION_CATCHING = 1
print >> sys.stderr, 'Warning: Applying some potentially unsafe optimizations! (Use -O2 if this fails.)'
- # TODO: apply -s settings in newargs here (after -Ox, so they can override it)
+ # Apply -s settings in newargs here (after -Ox, so they can override it)
+
+ for change in settings_changes:
+ key, value = change.split('=')
+ exec('shared.Settings.' + key + ' = ' + value)
temp_files = shared.TempFiles()
temp_files.note(target_basename + '.bc')