diff --git a/emcc.py b/emcc.py index 1ea34a40eb97f..7132cb07d6f44 100755 --- a/emcc.py +++ b/emcc.py @@ -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')