summaryrefslogtreecommitdiff
path: root/platform/javascript/SCsub
diff options
context:
space:
mode:
Diffstat (limited to 'platform/javascript/SCsub')
-rw-r--r--platform/javascript/SCsub17
1 files changed, 7 insertions, 10 deletions
diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub
index 1d3f96a6b8..b0302a5f88 100644
--- a/platform/javascript/SCsub
+++ b/platform/javascript/SCsub
@@ -27,8 +27,13 @@ if env["tools"]:
sys_env.AddJSLibraries(["js/libs/library_godot_editor_tools.js"])
if env["javascript_eval"]:
sys_env.AddJSLibraries(["js/libs/library_godot_eval.js"])
+
for lib in sys_env["JS_LIBS"]:
sys_env.Append(LINKFLAGS=["--js-library", lib])
+for js in env["JS_PRE"]:
+ sys_env.Append(LINKFLAGS=["--pre-js", env.File(js).path])
+for ext in env["JS_EXTERNS"]:
+ sys_env["ENV"]["EMCC_CLOSURE_ARGS"] += " --externs " + ext.path
build = []
if env["gdnative_enabled"]:
@@ -66,16 +71,8 @@ else:
build = sys_env.Program(build_targets, javascript_files + ["javascript_runtime.cpp"])
sys_env.Depends(build[0], sys_env["JS_LIBS"])
-
-if "JS_PRE" in env:
- for js in env["JS_PRE"]:
- env.Append(LINKFLAGS=["--pre-js", env.File(js).path])
- env.Depends(build, env["JS_PRE"])
-
-if "JS_EXTERNS" in env:
- for ext in env["JS_EXTERNS"]:
- env["ENV"]["EMCC_CLOSURE_ARGS"] += " --externs " + ext.path
- env.Depends(build, env["JS_EXTERNS"])
+sys_env.Depends(build[0], sys_env["JS_PRE"])
+sys_env.Depends(build[0], sys_env["JS_EXTERNS"])
engine = [
"js/engine/preloader.js",