summaryrefslogtreecommitdiffstats
path: root/platform/web/detect.py
diff options
context:
space:
mode:
Diffstat (limited to 'platform/web/detect.py')
-rw-r--r--platform/web/detect.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/platform/web/detect.py b/platform/web/detect.py
index d306869889..579eaaff03 100644
--- a/platform/web/detect.py
+++ b/platform/web/detect.py
@@ -44,7 +44,7 @@ def get_opts():
BoolVariable(
"proxy_to_pthread",
"Use Emscripten PROXY_TO_PTHREAD option to run the main application code to a separate thread",
- True,
+ False,
),
]
@@ -162,7 +162,7 @@ def configure(env: "Environment"):
env.AddMethod(create_template_zip, "CreateTemplateZip")
# Closure compiler extern and support for ecmascript specs (const, let, etc).
- env["ENV"]["EMCC_CLOSURE_ARGS"] = "--language_in ECMASCRIPT6"
+ env["ENV"]["EMCC_CLOSURE_ARGS"] = "--language_in ECMASCRIPT_2020"
env["CC"] = "emcc"
env["CXX"] = "em++"
@@ -186,9 +186,18 @@ def configure(env: "Environment"):
env["LIBPREFIXES"] = ["$LIBPREFIX"]
env["LIBSUFFIXES"] = ["$LIBSUFFIX"]
+ # Get version info for checks below.
+ cc_version = get_compiler_version(env)
+ cc_semver = (cc_version["major"], cc_version["minor"], cc_version["patch"])
+
env.Prepend(CPPPATH=["#platform/web"])
env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"])
+ if cc_semver >= (3, 1, 25):
+ env.Append(LINKFLAGS=["-s", "STACK_SIZE=5MB"])
+ else:
+ env.Append(LINKFLAGS=["-s", "TOTAL_STACK=5MB"])
+
if env["opengl3"]:
env.AppendUnique(CPPDEFINES=["GLES3_ENABLED"])
# This setting just makes WebGL 2 APIs available, it does NOT disable WebGL 1.
@@ -203,13 +212,10 @@ def configure(env: "Environment"):
env.Append(CPPDEFINES=["PTHREAD_NO_RENAME"])
env.Append(CCFLAGS=["-s", "USE_PTHREADS=1"])
env.Append(LINKFLAGS=["-s", "USE_PTHREADS=1"])
+ env.Append(LINKFLAGS=["-s", "DEFAULT_PTHREAD_STACK_SIZE=2MB"])
env.Append(LINKFLAGS=["-s", "PTHREAD_POOL_SIZE=8"])
env.Append(LINKFLAGS=["-s", "WASM_MEM_MAX=2048MB"])
- # Get version info for checks below.
- cc_version = get_compiler_version(env)
- cc_semver = (cc_version["major"], cc_version["minor"], cc_version["patch"])
-
if env["lto"] != "none":
# Workaround https://github.com/emscripten-core/emscripten/issues/19781.
if cc_semver >= (3, 1, 42) and cc_semver < (3, 1, 46):