diff options
Diffstat (limited to 'platform/javascript/detect.py')
-rw-r--r-- | platform/javascript/detect.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index c05b765c5e..1766833364 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -131,6 +131,18 @@ def configure(env): env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) + # Only include the JavaScript support code for the web environment + # (i.e. exclude Node.js and other unused environments). + # This makes the JavaScript support code about 4 KB smaller. + env.Append(LINKFLAGS=['-s', 'ENVIRONMENT=web']) + + # This needs to be defined for Emscripten using 'fastcomp' (default pre-1.39.0) + # and undefined if using 'upstream'. And to make things simple, earlier + # Emscripten versions didn't include 'fastcomp' in their path, so we check + # against the presence of 'upstream' to conditionally add the flag. + if not "upstream" in em_config['EMSCRIPTEN_ROOT']: + env.Append(LINKFLAGS=['-s', 'BINARYEN_TRAP_MODE=\'clamp\'']) + # Allow increasing memory buffer size during runtime. This is efficient # when using WebAssembly (in comparison to asm.js) and works well for # us since we don't know requirements at compile-time. |