diff --git a/cmake/QtWasmHelpers.cmake b/cmake/QtWasmHelpers.cmake index b30f5895c7a..3ce1e3f126b 100644 --- a/cmake/QtWasmHelpers.cmake +++ b/cmake/QtWasmHelpers.cmake @@ -25,10 +25,13 @@ function (qt_internal_setup_wasm_target_properties wasmTarget) target_compile_options("${wasmTarget}" INTERFACE -O2 -msimd128 -msse -msse2) endif() - # wasm exceptions + # exceptions if (QT_FEATURE_wasm_exceptions) target_compile_options("${wasmTarget}" INTERFACE -fwasm-exceptions) target_link_options("${wasmTarget}" INTERFACE -fwasm-exceptions) + elseif(QT_FEATURE_exceptions) + # add link option only, compile option is added in cross-platform code + target_link_options("${wasmTarget}" INTERFACE -fexceptions) endif() if (QT_FEATURE_thread)