From e2083871eb57e56fe637c3d8f6647ddb4ff539e0 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 23 Oct 2020 18:33:20 +0200 Subject: [HTML5] Port JavaScript inline code to libraries. The API is implemented in javascript, and generates C functions that can be called from godot. This allows much cleaner code replacing all `EM_ASM` calls in our C++ code with plain C function calls. This also gets rid of few hacks and comes with few optimizations (e.g. custom cursor shapes should be much faster now). --- platform/javascript/emscripten_helpers.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'platform/javascript/emscripten_helpers.py') diff --git a/platform/javascript/emscripten_helpers.py b/platform/javascript/emscripten_helpers.py index f6db10fbbd..cc874c432e 100644 --- a/platform/javascript/emscripten_helpers.py +++ b/platform/javascript/emscripten_helpers.py @@ -19,3 +19,9 @@ def create_engine_file(env, target, source, externs): if env["use_closure_compiler"]: return env.BuildJS(target, source, JSEXTERNS=externs) return env.Textfile(target, [env.File(s) for s in source]) + + +def add_js_libraries(env, libraries): + if "JS_LIBS" not in env: + env["JS_LIBS"] = [] + env.Append(JS_LIBS=env.File(libraries)) -- cgit v1.2.3