From b21e201d048067aa7c4ec3f9f7901ba9778d9372 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 22 Aug 2024 07:04:02 +0900 Subject: [PATCH] adjust memory setting for wasm, hoping to run it on mobile. --- web/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/CMakeLists.txt b/web/CMakeLists.txt index b9d1849e..334ce96c 100644 --- a/web/CMakeLists.txt +++ b/web/CMakeLists.txt @@ -53,7 +53,8 @@ if (EMSCRIPTEN) endif() # TODO: Adjust memory size. -set_target_properties(${BUILD_TARGET} PROPERTIES LINK_FLAGS "-s INITIAL_MEMORY=32MB -s TOTAL_MEMORY=256MB -sTOTAL_STACK=32MB -sASSERTIONS -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -sMODULARIZE -sEXPORT_ES6=1 --bind") +# 4MB stack +set_target_properties(${BUILD_TARGET} PROPERTIES LINK_FLAGS "-sENVIRONMENT='web,worker' -sSTACK_SIZE=4000000 -sASSERTIONS -s ALLOW_MEMORY_GROWTH=1 -sMODULARIZE=1 -sEXPORT_ES6 -sINVOKE_RUN=0 --bind") # ENVIRONMENT=web # SINGLE_FILE=1