Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(wechat): build the mini-game engine without auto-vectorization, so WeChat on iOS no longer takes itself down with the game

yhhd433f85c68a1
diff --git a/cmake/Emscripten.cmake b/cmake/Emscripten.cmake
index 606f6d57f..233a7980b 100644
--- a/cmake/Emscripten.cmake
+++ b/cmake/Emscripten.cmake
@@ -34,6 +34,8 @@ option(ES_MAIN_DISABLE_SIMD "Disable wasm SIMD for the main module (compat fallb
# has an i64 the SDK reads as a BigInt, so this costs nothing the game can see.
if(ES_BUILD_WXGAME)
add_link_options(-sWASM_BIGINT=0)
+ add_compile_options(-fno-vectorize -fno-slp-vectorize)
+ add_link_options(-Wl,-mllvm,-vectorize-loops=false -Wl,-mllvm,-vectorize-slp=false)
endif()
# The engine as plain JavaScript (emscripten's wasm2js, -sWASM=0) for a host that
# has no WebAssembly at all: the same C++, the same embind surface, the same SDK —