Skip to content

Commit 8009a1c

Browse files
committed
web: Use wasm exception when enabled
Always disable legacy exceptions.
1 parent 507ed9d commit 8009a1c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎tools/web.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ def generate(env):
5050
env.Append(CCFLAGS=["-sSUPPORT_LONGJMP='wasm'"])
5151
env.Append(LINKFLAGS=["-sSUPPORT_LONGJMP='wasm'"])
5252

53+
# Disable legacy exceptions
54+
env.Append(CCFLAGS=["-sWASM_LEGACY_EXCEPTIONS=0"])
55+
env.Append(LINKFLAGS=["-sWASM_LEGACY_EXCEPTIONS=0"])
56+
57+
if not env["disable_exceptions"]:
58+
env.Append(CCFLAGS=["-fwasm-exceptions"])
59+
env.Append(LINKFLAGS=["-fwasm-exceptions"])
60+
5361
env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"])
5462

5563
# Refer to https://github.com/godotengine/godot/blob/master/platform/web/detect.py

0 commit comments

Comments
 (0)