Detect javascript platform using EMSCRIPTEN env as well

(cherry picked from commit 33daf4d8bc)
This commit is contained in:
Marcelo Fernandez 2017-10-28 16:24:44 -03:00 committed by Rémi Verschelde
parent 42f00d002e
commit 20b821780c

View file

@ -12,7 +12,8 @@ def get_name():
def can_build(): def can_build():
return ("EMSCRIPTEN_ROOT" in os.environ)
return ("EMSCRIPTEN_ROOT" in os.environ or "EMSCRIPTEN" in os.environ)
def get_opts(): def get_opts():
@ -39,7 +40,11 @@ def configure(env):
env.Append(CPPPATH=['#platform/javascript']) env.Append(CPPPATH=['#platform/javascript'])
em_path = os.environ["EMSCRIPTEN_ROOT"] env['ENV'] = os.environ
if ("EMSCRIPTEN_ROOT" in os.environ):
em_path = os.environ["EMSCRIPTEN_ROOT"]
elif ("EMSCRIPTEN" in os.environ):
em_path = os.environ["EMSCRIPTEN"]
env['ENV']['PATH'] = em_path + ":" + env['ENV']['PATH'] env['ENV']['PATH'] = em_path + ":" + env['ENV']['PATH']