diff --git a/tools/web.py b/tools/web.py index 8953325c..dea42b26 100644 --- a/tools/web.py +++ b/tools/web.py @@ -35,12 +35,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"])