diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-01-22 22:18:02 +0100 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-01-31 12:33:16 +0100 |
commit | e818b51f32a96b5d27c70075f048bbfe1442243c (patch) | |
tree | 51fac111c4c1ed5e4060a33b091b4a6db25fed87 /platform | |
parent | 91b0be18dcc3ba3b1ecd35e8a7e416883776cf7b (diff) |
Only emit the JavaScript support code for Web when building for HTML5
Excluding other unused environments like Node.js makes the support code
about 4 KB smaller.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/javascript/detect.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 7bf3e1bc1d..1766833364 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -131,6 +131,11 @@ 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 |