[HTML5] Use absolute path for JS lib/pre/externs.

Ensure better compatibility when emcc which may run some tools from
different paths (e.g. closure compiler).

This fixes externs include issues with modern emcc using the closure
compiler.

(cherry picked from commit eaedc92c61)
This commit is contained in:
Fabio Alessandrelli 2021-11-26 12:44:51 +01:00 committed by Rémi Verschelde
parent afa8844679
commit 8fb897ecfa
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -27,11 +27,11 @@ if env["javascript_eval"]:
sys_env.AddJSLibraries(["js/libs/library_godot_javascript_singleton.js"])
for lib in sys_env["JS_LIBS"]:
sys_env.Append(LINKFLAGS=["--js-library", lib])
sys_env.Append(LINKFLAGS=["--js-library", lib.abspath])
for js in env["JS_PRE"]:
sys_env.Append(LINKFLAGS=["--pre-js", env.File(js).path])
sys_env.Append(LINKFLAGS=["--pre-js", js.abspath])
for ext in env["JS_EXTERNS"]:
sys_env["ENV"]["EMCC_CLOSURE_ARGS"] += " --externs " + ext.path
sys_env["ENV"]["EMCC_CLOSURE_ARGS"] += " --externs " + ext.abspath
build = []
if env["gdnative_enabled"]: