Skip to content

Commit

Permalink
Fix: [Emscripten] compile with exceptions enabled, as our AIs depend …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
TrueBrain committed Dec 25, 2020
1 parent 79cb9ef commit e0b953b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -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\"]'")
Expand Down

0 comments on commit e0b953b

Please sign in to comment.