summaryrefslogtreecommitdiff
path: root/platform/javascript/SCsub
diff options
context:
space:
mode:
Diffstat (limited to 'platform/javascript/SCsub')
-rw-r--r--platform/javascript/SCsub12
1 files changed, 7 insertions, 5 deletions
diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub
index fa9e6eed15..4827dc4627 100644
--- a/platform/javascript/SCsub
+++ b/platform/javascript/SCsub
@@ -28,15 +28,17 @@ 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"]:
build_targets = ["#bin/godot${PROGSUFFIX}.js", "#bin/godot${PROGSUFFIX}.wasm"]
+ if env["threads_enabled"]:
+ build_targets.append("#bin/godot${PROGSUFFIX}.worker.js")
# Reset libraries. The main runtime will only link emscripten libraries, not godot ones.
sys_env["LIBS"] = []
# We use IDBFS. Since Emscripten 1.39.1 it needs to be linked explicitly.
@@ -58,7 +60,7 @@ if env["gdnative_enabled"]:
wasm_env.Append(CCFLAGS=["-s", "SIDE_MODULE=2"])
wasm_env.Append(LINKFLAGS=["-s", "SIDE_MODULE=2"])
wasm = wasm_env.add_program("#bin/godot.side${PROGSUFFIX}.wasm", javascript_files)
- build = [sys[0], sys[1], wasm[0]]
+ build = sys + [wasm[0]]
else:
build_targets = ["#bin/godot${PROGSUFFIX}.js", "#bin/godot${PROGSUFFIX}.wasm"]
if env["threads_enabled"]:
@@ -87,5 +89,5 @@ wrap_list = [
js_wrapped = env.Textfile("#bin/godot", [env.File(f) for f in wrap_list], TEXTFILESUFFIX="${PROGSUFFIX}.wrapped.js")
# Extra will be the thread worker, or the GDNative side, or None
-extra = build[2] if len(build) > 2 else None
+extra = build[2:] if len(build) > 2 else None
env.CreateTemplateZip(js_wrapped, build[1], extra)