From a95dfa6ea07a3d986acca113e18f4f54adfb63b1 Mon Sep 17 00:00:00 2001 From: Jordan Schidlowsky Date: Wed, 25 Sep 2024 10:13:57 -0600 Subject: [PATCH] Optimized shrink options to binaryen wasm-opt pass --- platform/web/detect.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/web/detect.py b/platform/web/detect.py index bf75c2f9fcf..f016d6ff620 100644 --- a/platform/web/detect.py +++ b/platform/web/detect.py @@ -285,6 +285,9 @@ def configure(env: "SConsEnvironment"): env.Append(CCFLAGS=["-sSUPPORT_LONGJMP='wasm'"]) env.Append(LINKFLAGS=["-sSUPPORT_LONGJMP='wasm'"]) + # Run wasm-opt binaryen maximum shrink options + env.Append(LINKFLAGS=["-sBINARYEN_EXTRA_PASSES='-Oz'"]) + # 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.