diff options
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f8c5ee8d2..4e8e780bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -327,7 +327,6 @@ if(EMSCRIPTEN) endif() if("${CMAKE_BUILD_TYPE}" MATCHES "Release") - add_link_flag("-sSINGLE_FILE") # Extra check that cmake has set -O3 in its release flags. # This is really as an assertion that cmake is behaving as we expect. if(NOT CMAKE_CXX_FLAGS_RELEASE_INIT MATCHES "-O3") @@ -336,6 +335,7 @@ if(EMSCRIPTEN) endif() add_link_flag("-sALLOW_MEMORY_GROWTH") + add_link_flag("-sSTACK_SIZE=5MB") if(EMSCRIPTEN_ENABLE_WASM_EH) add_compile_flag("-fwasm-exceptions") else() @@ -348,14 +348,15 @@ if(EMSCRIPTEN) if(BUILD_FOR_BROWSER) add_link_flag("-sENVIRONMENT=web,worker") add_link_flag("-sINVOKE_RUN=0") - add_link_flag("-sEXPORTED_RUNTIME_METHODS=run,callMain,FS") + add_link_flag("-sEXPORTED_RUNTIME_METHODS=run,callMain,FS") add_link_flag("-sMODULARIZE") add_link_flag("-sEXPORT_ES6") add_link_flag("-sFILESYSTEM") - add_link_flag("-sFORCE_FILESYSTEM") + add_link_flag("-sFORCE_FILESYSTEM") + else() # On Node.js, make the tools immediately usable. - else() add_link_flag("-sNODERAWFS") + add_link_flag("-sSINGLE_FILE") endif() # in opt builds, LTO helps so much (>20%) it's worth slow compile times add_nondebug_compile_flag("-flto") |