diff options
| author | Rémi Verschelde | 2016-11-14 08:26:24 +0100 |
|---|---|---|
| committer | GitHub | 2016-11-14 08:26:24 +0100 |
| commit | 715ab48a5439d44200e5c44427441d9613c1e720 (patch) | |
| tree | d08036e7b52f39ba4faf08436a003c05feb5e3f4 /platform/javascript/detect.py | |
| parent | add2cf65a6463b615b73b005f02a46aec13613fc (diff) | |
| parent | d87b1d1338472514e96c3cd8857d050d54a9d1e7 (diff) | |
| download | godot-715ab48a5439d44200e5c44427441d9613c1e720.tar.gz godot-715ab48a5439d44200e5c44427441d9613c1e720.tar.zst godot-715ab48a5439d44200e5c44427441d9613c1e720.zip | |
Merge pull request #7107 from eska014/wasm
Some WebAssembly stuff
Diffstat (limited to 'platform/javascript/detect.py')
| -rw-r--r-- | platform/javascript/detect.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 9bc204a94..35352becf 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -76,6 +76,7 @@ def configure(env): if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): env.opus_fixed_point = "yes" + # These flags help keep the file size down env.Append(CPPFLAGS=["-fno-exceptions", '-DNO_SAFE_CAST', '-fno-rtti']) env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DNO_FCNTL', '-DMPC_FIXED_POINT', '-DTYPED_METHOD_BIND', '-DNO_THREADS']) env.Append(CPPFLAGS=['-DGLES2_ENABLED']) @@ -85,7 +86,12 @@ def configure(env): if env['wasm'] == 'yes': env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) - env.Append(LINKFLAGS=['-s', '\'BINARYEN_METHOD="native-wasm"\'']) + # Maximum memory size is baked into the WebAssembly binary during + # compilation, so we need to enable memory growth to allow setting + # TOTAL_MEMORY at runtime. The value set at runtime must be higher than + # what is set during compilation, check TOTAL_MEMORY in Emscripten's + # src/settings.js for the default. + env.Append(LINKFLAGS=['-s', 'ALLOW_MEMORY_GROWTH=1']) env["PROGSUFFIX"] += ".webassembly" else: env.Append(CPPFLAGS=['-s', 'ASM_JS=1']) |
