summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2020-12-25 20:04:48 +0100
committerPatric Stout <github@truebrain.nl>2020-12-25 20:56:25 +0100
commite0b953b80404b37cc5b85a2b88ce0c548ebbc2c8 (patch)
treeeef98385744bc630dd0790147b2c82bef23b615e
parent79cb9efa7f7adb250fd25bee2200165ddd77817e (diff)
downloadopenttd-e0b953b80404b37cc5b85a2b88ce0c548ebbc2c8.tar.xz
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
-rw-r--r--CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca2284ffc..bbde268c4 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\"]'")