From e0b953b80404b37cc5b85a2b88ce0c548ebbc2c8 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Fri, 25 Dec 2020 20:04:48 +0100 Subject: [PATCH] Fix: [Emscripten] compile with exceptions enabled, as our AIs depend on it Also parts of the saveload code does, and some other places. This does slow down builds, but for most computers this will not be measurable. At least, the ones I had access to I could not find a difference in FPS, mainly as that is heavily limited by the Hz of the screens of the computer. Either way, it is better to have a full functional game than a fast one in my opinion --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca2284ffc1..bbde268c4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,6 +242,8 @@ if(EMSCRIPTEN) # Allow heap-growth, and start with a bigger memory size. target_link_libraries(WASM::WASM INTERFACE "-s ALLOW_MEMORY_GROWTH=1") target_link_libraries(WASM::WASM INTERFACE "-s INITIAL_MEMORY=33554432") + target_link_libraries(WASM::WASM INTERFACE "-s DISABLE_EXCEPTION_CATCHING=0") + add_definitions(-s DISABLE_EXCEPTION_CATCHING=0) # Export functions to Javascript. target_link_libraries(WASM::WASM INTERFACE "-s EXPORTED_FUNCTIONS='[\"_main\", \"_em_openttd_add_server\"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'")