From 0f43a04de77a08fe5e0fd1e589af0486708b7bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Wed, 21 Dec 2022 14:22:59 +0100 Subject: [PATCH] wasm: fix up new configure options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make options for enabling "simd128" and "exceptions" public: -feature-wasm-simd128 -feature-wasm-exceptions Make sure both appear in the config summary and feature list. Move the exceptions code so that they are next to each other in the cmake file. Change-Id: I3975b56703f40f7ffff270754535bc2eb5bfe488 Reviewed-by: Mikołaj Boc Reviewed-by: Morten Johan Sørvig (cherry picked from commit ce560d28c8b426d3cb797fa04e9e78d980fc8501) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtWasmHelpers.cmake | 6 +++--- configure.cmake | 27 +++++++++++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/cmake/QtWasmHelpers.cmake b/cmake/QtWasmHelpers.cmake index b2436f2bda7..614a677ae3d 100644 --- a/cmake/QtWasmHelpers.cmake +++ b/cmake/QtWasmHelpers.cmake @@ -35,13 +35,13 @@ function (qt_internal_setup_wasm_target_properties wasmTarget) endif() # wasm exceptions - if (QT_FEATURE_wasm_exception) + if (QT_FEATURE_wasm_exceptions) target_compile_options("${wasmTarget}" INTERFACE -fwasm-exceptions) target_link_options("${wasmTarget}" INTERFACE -fwasm-exceptions) + else() + target_link_options("${wasmTarget}" INTERFACE "SHELL:-s DISABLE_EXCEPTION_CATCHING=1") endif() - target_link_options("${wasmTarget}" INTERFACE "SHELL:-s DISABLE_EXCEPTION_CATCHING=1") - if (QT_FEATURE_thread) target_compile_options("${wasmTarget}" INTERFACE "SHELL:-pthread") target_link_options("${wasmTarget}" INTERFACE "SHELL:-pthread") diff --git a/configure.cmake b/configure.cmake index 95995a558df..776299189bd 100644 --- a/configure.cmake +++ b/configure.cmake @@ -929,23 +929,26 @@ qt_feature("arm_crypto" PRIVATE qt_feature_definition("arm_crypto" "QT_COMPILER_SUPPORTS_AES" VALUE "1") qt_feature_config("arm_crypto" QMAKE_PRIVATE_CONFIG) -qt_feature("wasm_simd128" PRIVATE +qt_feature("wasm-simd128" PUBLIC LABEL "WebAssembly SIMD128" + PURPOSE "Enables WebAssembly SIMD" AUTODETECT OFF ) -qt_feature_definition("wasm_simd128" "QT_COMPILER_SUPPORTS_WASM_SIMD128" VALUE "1") -qt_feature_config("wasm_simd128" QMAKE_PRIVATE_CONFIG) +qt_feature_definition("wasm-simd128" "QT_COMPILER_SUPPORTS_WASM_SIMD128" VALUE "1") +qt_feature_config("wasm-simd128" QMAKE_PRIVATE_CONFIG) + +qt_feature("wasm-exceptions" PUBLIC + LABEL "WebAssembly Exceptions" + PURPOSE "Enables WebAssembly Exceptions" + AUTODETECT OFF +) +qt_feature_definition("wasm-exceptions" "QT_WASM_EXCEPTIONS" VALUE "1") +qt_feature_config("wasm-exceptions" QMAKE_PRIVATE_CONFIG) qt_feature("posix_fallocate" PRIVATE LABEL "POSIX fallocate()" CONDITION TEST_posix_fallocate ) -qt_feature("wasm_exceptions" PRIVATE - LABEL "WebAssembly exception handling" - AUTODETECT OFF -) -qt_feature_definition("wasm_exceptions" "QT_WASM_EXCEPTIONS" VALUE "1") -qt_feature_config("wasm_exceptions" QMAKE_PRIVATE_CONFIG) qt_feature("alloca_h" PRIVATE LABEL "alloca.h" CONDITION TEST_alloca_h @@ -1172,7 +1175,11 @@ qt_configure_add_summary_entry(ARGS "precompile_header") qt_configure_add_summary_entry(ARGS "ltcg") qt_configure_add_summary_entry(ARGS "intelcet") qt_configure_add_summary_entry( - ARGS "wasm_simd128" + ARGS "wasm-simd128" + CONDITION ( TEST_architecture_arch STREQUAL wasm ) +) +qt_configure_add_summary_entry( + ARGS "wasm-exceptions" CONDITION ( TEST_architecture_arch STREQUAL wasm ) ) qt_configure_add_summary_section(NAME "Target compiler supports")