diff --git a/platform/web/SCsub b/platform/web/SCsub index 7ba12eecb96b..ad01f527b4d9 100644 --- a/platform/web/SCsub +++ b/platform/web/SCsub @@ -59,8 +59,12 @@ for lib in sys_env["JS_LIBS"]: sys_env.Append(LINKFLAGS=["--js-library", lib.abspath]) for js in sys_env["JS_PRE"]: sys_env.Append(LINKFLAGS=["--pre-js", js.abspath]) + +# Add JS externs to Closure. +sys_env["ENV"]["EMCC_CLOSURE_ARGS"] = sys_env["ENV"].get("EMCC_CLOSURE_ARGS", "") for ext in sys_env["JS_EXTERNS"]: sys_env["ENV"]["EMCC_CLOSURE_ARGS"] += " --externs " + ext.abspath +sys_env["ENV"]["EMCC_CLOSURE_ARGS"] = sys_env["ENV"]["EMCC_CLOSURE_ARGS"].strip() build = [] build_targets = ["#bin/godot${PROGSUFFIX}.js", "#bin/godot${PROGSUFFIX}.wasm"] diff --git a/platform/web/detect.py b/platform/web/detect.py index 0620c93f4914..2eff073cd980 100644 --- a/platform/web/detect.py +++ b/platform/web/detect.py @@ -166,9 +166,6 @@ def configure(env: "SConsEnvironment"): # Add method for creating the final zip file env.AddMethod(create_template_zip, "CreateTemplateZip") - # Closure compiler extern and support for ecmascript specs (const, let, etc). - env["ENV"]["EMCC_CLOSURE_ARGS"] = "--language_in ECMASCRIPT_2021" - env["CC"] = "emcc" env["CXX"] = "em++"