Skip to content

Commit

Permalink
Merge pull request #1489 from Faless/web/longjmp
Browse files Browse the repository at this point in the history
[Web] Force emcc to use "wasm" longjmp mode
  • Loading branch information
dsnopek authored Jun 17, 2024
2 parents f2ac49a + 1bb543b commit 89831ff
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tools/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ def generate(env):

# Thread support (via SharedArrayBuffer).
if env["threads"]:
env.Append(CCFLAGS=["-s", "USE_PTHREADS=1"])
env.Append(LINKFLAGS=["-s", "USE_PTHREADS=1"])
env.Append(CCFLAGS=["-sUSE_PTHREADS=1"])
env.Append(LINKFLAGS=["-sUSE_PTHREADS=1"])

# Build as side module (shared library).
env.Append(CPPFLAGS=["-s", "SIDE_MODULE=1"])
env.Append(LINKFLAGS=["-s", "SIDE_MODULE=1"])
env.Append(CPPFLAGS=["-sSIDE_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"])

Expand Down

0 comments on commit 89831ff

Please sign in to comment.