Merge pull request #1489 from Faless/web/longjmp

[Web] Force emcc to use "wasm" longjmp mode
pull/1496/head
David Snopek 2024-06-17 11:53:05 -05:00 committed by GitHub
commit 89831ff333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 4 deletions

View File

@ -36,12 +36,16 @@ def generate(env):
# Thread support (via SharedArrayBuffer). # Thread support (via SharedArrayBuffer).
if env["threads"]: if env["threads"]:
env.Append(CCFLAGS=["-s", "USE_PTHREADS=1"]) env.Append(CCFLAGS=["-sUSE_PTHREADS=1"])
env.Append(LINKFLAGS=["-s", "USE_PTHREADS=1"]) env.Append(LINKFLAGS=["-sUSE_PTHREADS=1"])
# Build as side module (shared library). # Build as side module (shared library).
env.Append(CPPFLAGS=["-s", "SIDE_MODULE=1"]) env.Append(CPPFLAGS=["-sSIDE_MODULE=1"])
env.Append(LINKFLAGS=["-s", "SIDE_MODULE=1"]) env.Append(LINKFLAGS=["-sSIDE_MODULE=1"])
# Force wasm longjmp mode.
env.Append(CCFLAGS=["-sSUPPORT_LONGJMP='wasm'"])
env.Append(LINKFLAGS=["-sSUPPORT_LONGJMP='wasm'"])
env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"]) env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"])