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.
This commit is contained in:
Hugo Locurcio 2020-01-22 22:18:02 +01:00
parent 91b0be18dc
commit e818b51f32
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
1 changed files with 5 additions and 0 deletions

View File

@ -131,6 +131,11 @@ def configure(env):
env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) 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) # 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 # and undefined if using 'upstream'. And to make things simple, earlier
# Emscripten versions didn't include 'fastcomp' in their path, so we check # Emscripten versions didn't include 'fastcomp' in their path, so we check