From 140701c0e513bb62785153468644dfd5af36347a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Tue, 8 Oct 2024 15:22:17 +0200 Subject: [PATCH] wasm: set longjmp type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set the longjump type according to the exceptions type selected at Qt configure time. These should match in order to produce a working build. Task-number: QTBUG-129747 Change-Id: Idd8640b374fd0ac52db785985e82cc26f3548674 Reviewed-by: Piotr WierciƄski Reviewed-by: Lorn Potter --- cmake/QtWasmHelpers.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/QtWasmHelpers.cmake b/cmake/QtWasmHelpers.cmake index 3ce1e3f126b..20bd5b333d6 100644 --- a/cmake/QtWasmHelpers.cmake +++ b/cmake/QtWasmHelpers.cmake @@ -34,6 +34,13 @@ function (qt_internal_setup_wasm_target_properties wasmTarget) target_link_options("${wasmTarget}" INTERFACE -fexceptions) endif() + # setjmp/longjmp type. The type is "emscripten" by default, but must + # be set to "wasm" when wasm-exceptions are used, for compatibility reasons. + if (QT_FEATURE_wasm_exceptions) + target_compile_options("${wasmTarget}" INTERFACE -s SUPPORT_LONGJMP=wasm) + target_link_options("${wasmTarget}" INTERFACE -s SUPPORT_LONGJMP=wasm) + endif() + if (QT_FEATURE_thread) target_compile_options("${wasmTarget}" INTERFACE "SHELL:-pthread") target_link_options("${wasmTarget}" INTERFACE "SHELL:-pthread")