aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2021-04-22 19:20:32 +0100
committerSimon Tatham <anakin@pobox.com>2021-04-22 21:22:48 +0100
commit77866e1335bd1ea7189f11c19ff2947be17aa517 (patch)
tree1f5d0dd32cc71e20d67c44033b23e38726af64d7 /cmake
parent56ef86f92b77412bfe27d7206d25b323475e71fe (diff)
downloadpuzzles-77866e1335bd1ea7189f11c19ff2947be17aa517.zip
puzzles-77866e1335bd1ea7189f11c19ff2947be17aa517.tar.gz
puzzles-77866e1335bd1ea7189f11c19ff2947be17aa517.tar.bz2
puzzles-77866e1335bd1ea7189f11c19ff2947be17aa517.tar.xz
wasm/js/emscripten: Fix page loading race
Using a stunt webserver which artificially introduces a 3s delay just before the last line of the HTML output, I have reproduced a uwer-reported loading/startup race bug: Previously the wasm loading was started by the <script> element, synchronously. If the wasm loading is fast, and finishes before the HTML loading, the onRuntimeInitialized event may occur before initPuzzles. But initPuzzles sets up the event handler. Fix this bug, and introduce a new comment containing an argument for the correctness of the new approach. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/platforms/emscripten.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmake/platforms/emscripten.cmake b/cmake/platforms/emscripten.cmake
index bbb0897..c7e55fe 100644
--- a/cmake/platforms/emscripten.cmake
+++ b/cmake/platforms/emscripten.cmake
@@ -43,6 +43,7 @@ endfunction()
function(set_platform_puzzle_target_properties NAME TARGET)
em_link_pre_js(${TARGET} ${CMAKE_SOURCE_DIR}/emccpre.js)
em_link_js_library(${TARGET} ${CMAKE_SOURCE_DIR}/emcclib.js)
+ em_link_post_js(${TARGET} ${CMAKE_SOURCE_DIR}/emccpost.js)
endfunction()
function(build_platform_extras)