Skip to content

Commit

Permalink
Explicitly reject -s BINARYEN_METHOD='someinvalidoption' modes that a…
Browse files Browse the repository at this point in the history
…ren't recognized.
  • Loading branch information
juj committed Dec 15, 2016
1 parent e101571 commit a836038
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2008,6 +2008,14 @@ def do_minify(): # minifies the code. this is also when we do certain optimizati
print jsrun.run_js(shared.path_from_root('tools', 'js-optimizer.js'), shared.NODE_JS, args=[asm_target, 'eliminateDeadGlobals', 'last', 'asm'], stdout=open(temp, 'w'))
shutil.move(temp, asm_target)

if shared.Settings.BINARYEN_METHOD:
methods = shared.Settings.BINARYEN_METHOD.split(',')
valid_methods = ['asmjs', 'native-wasm', 'interpret-s-expr', 'interpret-binary', 'interpret-asm2wasm']
for m in methods:
if not m.strip() in valid_methods:
logging.error('Unrecognized BINARYEN_METHOD "' + m.strip() + '" specified! Please pass a comma-delimited list containing one or more of: ' + ','.join(valid_methods))
sys.exit(1)

if shared.Settings.BINARYEN:
logging.debug('using binaryen, with method: ' + shared.Settings.BINARYEN_METHOD)
binaryen_bin = os.path.join(shared.Settings.BINARYEN_ROOT, 'bin')
Expand Down

0 comments on commit a836038

Please sign in to comment.