diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2024-06-13 23:42:41 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2024-06-14 16:03:56 +0200 |
commit | 7af8c494ab885911f5796c7b16a1a0314f2d6c67 (patch) | |
tree | e1e582377cbec6434dda3b4326a19890dc126c95 | |
parent | e874cd84f0b21387ddc3091b6d594b2d6a8c4b6d (diff) | |
download | redot-engine-7af8c494ab885911f5796c7b16a1a0314f2d6c67.tar.gz |
[Web] Force emcc to use "wasm" longjmp mode
SUPPORT_LONGJMP have changed since emscripten 3.1.32 to default to
"wasm" mode when exceptions are enabled, and "emscripten" mode when
disabled.
While we generally doesn't use exception in core, linked libraries may
need them, and emscripten don't plan to support WASM EH + Emscripten
SjLj in the long term.
-rw-r--r-- | platform/web/detect.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/web/detect.py b/platform/web/detect.py index 7d6a8052ce..1b15ff8e2e 100644 --- a/platform/web/detect.py +++ b/platform/web/detect.py @@ -276,6 +276,10 @@ def configure(env: "SConsEnvironment"): # Wrap the JavaScript support code around a closure named Godot. env.Append(LINKFLAGS=["-sMODULARIZE=1", "-sEXPORT_NAME='Godot'"]) + # Force long jump mode to 'wasm' + env.Append(CCFLAGS=["-sSUPPORT_LONGJMP='wasm'"]) + env.Append(LINKFLAGS=["-sSUPPORT_LONGJMP='wasm'"]) + # Allow increasing memory buffer size during runtime. This is efficient # when using WebAssembly (in comparison to asm.js) and works well for # us since we don't know requirements at compile-time. |