summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorten Sørvig <morten.sorvig@qt.io>2023-01-30 22:44:48 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-07 12:57:38 +0000
commite35b48f44e4b2ff8d0808e16729792a4bed90215 (patch)
tree3598d1c1381c44d24c30a096791b8e4a81560e72
parent27e79dcd1e93a84e9593e91c485f113be563c571 (diff)
downloadqtdoc-e35b48f44e4b2ff8d0808e16729792a4bed90215.tar.gz
wasm: document wasm exceptions support
The -feature-wasm-exceptions configure option enables exceptions at compile and link time. Note that a workaround is required for app->exec() calls, where main() must be changed to return early and not call exec() Change-Id: I77a075999de5cd6296083049491ffcfff0fe14eb Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> (cherry picked from commit 587f34161b6f1c1a8e348749d316feef282fda55) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--doc/src/platforms/wasm.qdoc13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/src/platforms/wasm.qdoc b/doc/src/platforms/wasm.qdoc
index 19b124d2..6f555ee7 100644
--- a/doc/src/platforms/wasm.qdoc
+++ b/doc/src/platforms/wasm.qdoc
@@ -620,6 +620,19 @@ To enable asyncify, configure Qt using:
-device-option QT_EMSCRIPTEN_ASYNCIFY=1
\endcode
+\section2 Wasm Exceptions
+
+Qt is built without exception support by default, where throwing an exception will abort
+the program. \l{https://emscripten.org/docs/porting/exceptions.html#webassembly-exception-handling-based-support}
+{WebAssembly exceptions} can be enabled by building from source and passing the -feature-wasm-exceptions
+flag to Qt configure. This will pass the -fwasm-exceptions flag to the compiler at compile and
+link time. Qt does not support enabling Emscripten's support for the earlier JavaScript-based
+exception implementation.
+
+Note that calling QApplication::exec() is not supported when exceptions are enabled, due to
+internal implementation details. Instead, write main() in the form where it returns early and
+does not call exec(), as described in \l{Application Startup and the Event Loop}.
+
\section2 Known Issues
\list