Browse Source

Fix Emscripten root directory detection when building for HTML5

Recent Emscripten SDK versions seem to only include the
`BINARYEN_ROOT` variable in the Emscripten configuration file,
whereas the platform's `detect.py` only looked at `EMSCRIPTEN_ROOT`.
Hugo Locurcio 6 years ago
parent
commit
e08fa103f2
1 changed files with 3 additions and 3 deletions
  1. 3 3
      platform/javascript/detect.py

+ 3 - 3
platform/javascript/detect.py

@@ -69,9 +69,9 @@ def configure(env):
             exec(f.read(), em_config)
             exec(f.read(), em_config)
         except StandardError as e:
         except StandardError as e:
             raise RuntimeError("Emscripten configuration file '%s' is invalid:\n%s" % (em_config_file, e))
             raise RuntimeError("Emscripten configuration file '%s' is invalid:\n%s" % (em_config_file, e))
-    if 'EMSCRIPTEN_ROOT' not in em_config:
-        raise RuntimeError("'EMSCRIPTEN_ROOT' missing in Emscripten configuration file '%s'" % em_config_file)
-    env.PrependENVPath('PATH', em_config['EMSCRIPTEN_ROOT'])
+    if 'BINARYEN_ROOT' not in em_config and 'EMSCRIPTEN_ROOT' not in em_config:
+        raise RuntimeError("'BINARYEN_ROOT' or 'EMSCRIPTEN_ROOT' missing in Emscripten configuration file '%s'" % em_config_file)
+    env.PrependENVPath('PATH', em_config.get('BINARYEN_ROOT', em_config.get('EMSCRIPTEN_ROOT')))
 
 
     env['CC'] = 'emcc'
     env['CC'] = 'emcc'
     env['CXX'] = 'em++'
     env['CXX'] = 'em++'