diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2021-09-17 11:40:14 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2021-11-04 09:23:11 +0200 |
commit | 6d039a5e7675542103d6fad8fcc38d6c17d26e20 (patch) | |
tree | 761b7ceb7d6f3150c16e46fd407d5a9635ce42f1 /cmake | |
parent | 63feecfc11640d66b6b0c663f97ffcc0abfb6181 (diff) |
wasm: enable event dispatcher asyncify support
Misc. fixes, including:
Fix a couple of typos in the JavaScript code. Also, macros-
within-macros don’t work, (without resorting to preprocessor
token pasting), so remove the debug output for now.
Limit the exec() “simulateInfiniteLoop” workaround to
top-level application exec() only. This way, asyncify
can be used for nested QEventLoop::exec() calls. (Emscripten
supports one level of suspend only, so we don’t want
to use that for the top-level exec(), but instead use it
for dialogs and such).
Use the new QEventLoop::ProcessEventsFlag::ApplicationExec
enum value to detect the exec() call type.
Change-Id: Ic702bfc31faf2e9f84ac5d3ccf43d067c5c61bf0
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtWasmHelpers.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtWasmHelpers.cmake b/cmake/QtWasmHelpers.cmake index d3734c287b..592db0d0db 100644 --- a/cmake/QtWasmHelpers.cmake +++ b/cmake/QtWasmHelpers.cmake @@ -104,7 +104,7 @@ function (qt_internal_setup_wasm_target_properties wasmTarget) set(QT_CFLAGS_OPTIMIZE_DEBUG "-Os" CACHE STRING INTERNAL FORCE) set(QT_FEATURE_optimize_debug ON CACHE BOOL INTERNAL FORCE) - target_link_options("${wasmTarget}" INTERFACE "SHELL:-s ASYNCIFY" "-Os") + target_link_options("${wasmTarget}" INTERFACE "SHELL:-s ASYNCIFY" "-Os" "-s" "ASYNCIFY_IMPORTS=[qt_asyncify_suspend_js, qt_asyncify_resume_js]") target_compile_definitions("${wasmTarget}" INTERFACE QT_HAVE_EMSCRIPTEN_ASYNCIFY) endif() endfunction() |