summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-31 18:36:29 +0100
committerGitHub <noreply@github.com>2020-01-31 18:36:29 +0100
commit8eef6d280b42f098e15d0e1e6acf8189ae4be489 (patch)
treea316fc089358a60a2cb4315eabf2986d557e9818
parent2a1e21b6b1c37ce1774aa8661925f980092a6915 (diff)
parente818b51f32a96b5d27c70075f048bbfe1442243c (diff)
Merge pull request #35451 from Calinou/html5-web-environment-only
Only emit the JavaScript support code for Web when building for HTML5
-rw-r--r--platform/javascript/detect.py5
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