Allow specifying EMSCRIPTEN_NATIVE_OPTIMIZER in .emscripten to configure the location of the native optimizer.

This commit is contained in:
Jukka Jylänki 2014-12-19 10:52:42 -05:00
Родитель 2bb3bcfbbf
Коммит 21e5be3156
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -30,7 +30,10 @@ NATIVE_OPTIMIZER = os.environ.get('EMCC_NATIVE_OPTIMIZER') or '1' # use native o
def get_native_optimizer():
if os.environ.get('EMCC_FAST_COMPILER') == '0': return None # need fastcomp for native optimizer
if len(os.environ.get('EMSCRIPTEN_NATIVE_OPTIMIZER')) > 0: return os.environ.get('EMSCRIPTEN_NATIVE_OPTIMIZER')
# Allow users to override the location of the optimizer executable by setting an environment variable EMSCRIPTEN_NATIVE_OPTIMIZER=/path/to/optimizer(.exe)
if os.environ.get('EMSCRIPTEN_NATIVE_OPTIMIZER') and len(os.environ.get('EMSCRIPTEN_NATIVE_OPTIMIZER')) > 0: return os.environ.get('EMSCRIPTEN_NATIVE_OPTIMIZER')
# Also, allow specifying the location of the optimizer in .emscripten configuration file under EMSCRIPTEN_NATIVE_OPTIMIZER='/path/to/optimizer'
if hasattr(shared, 'EMSCRIPTEN_NATIVE_OPTIMIZER') and len(shared.EMSCRIPTEN_NATIVE_OPTIMIZER) > 0: return shared.EMSCRIPTEN_NATIVE_OPTIMIZER
FAIL_MARKER = shared.Cache.get_path('optimizer.building_failed')
if os.path.exists(FAIL_MARKER):