wasm: fix up new configure options

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 <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit ce560d28c8b426d3cb797fa04e9e78d980fc8501)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Morten Sørvig 2022-12-21 14:22:59 +01:00 committed by Qt Cherry-pick Bot
parent 22c48a4e02
commit 0f43a04de7
2 changed files with 20 additions and 13 deletions

View File

@ -35,13 +35,13 @@ function (qt_internal_setup_wasm_target_properties wasmTarget)
endif() endif()
# wasm exceptions # wasm exceptions
if (QT_FEATURE_wasm_exception) if (QT_FEATURE_wasm_exceptions)
target_compile_options("${wasmTarget}" INTERFACE -fwasm-exceptions) target_compile_options("${wasmTarget}" INTERFACE -fwasm-exceptions)
target_link_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() endif()
target_link_options("${wasmTarget}" INTERFACE "SHELL:-s DISABLE_EXCEPTION_CATCHING=1")
if (QT_FEATURE_thread) if (QT_FEATURE_thread)
target_compile_options("${wasmTarget}" INTERFACE "SHELL:-pthread") target_compile_options("${wasmTarget}" INTERFACE "SHELL:-pthread")
target_link_options("${wasmTarget}" INTERFACE "SHELL:-pthread") target_link_options("${wasmTarget}" INTERFACE "SHELL:-pthread")

View File

@ -929,23 +929,26 @@ qt_feature("arm_crypto" PRIVATE
qt_feature_definition("arm_crypto" "QT_COMPILER_SUPPORTS_AES" VALUE "1") qt_feature_definition("arm_crypto" "QT_COMPILER_SUPPORTS_AES" VALUE "1")
qt_feature_config("arm_crypto" QMAKE_PRIVATE_CONFIG) qt_feature_config("arm_crypto" QMAKE_PRIVATE_CONFIG)
qt_feature("wasm_simd128" PRIVATE qt_feature("wasm-simd128" PUBLIC
LABEL "WebAssembly SIMD128" LABEL "WebAssembly SIMD128"
PURPOSE "Enables WebAssembly SIMD"
AUTODETECT OFF AUTODETECT OFF
) )
qt_feature_definition("wasm_simd128" "QT_COMPILER_SUPPORTS_WASM_SIMD128" VALUE "1") qt_feature_definition("wasm-simd128" "QT_COMPILER_SUPPORTS_WASM_SIMD128" VALUE "1")
qt_feature_config("wasm_simd128" QMAKE_PRIVATE_CONFIG) 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 qt_feature("posix_fallocate" PRIVATE
LABEL "POSIX fallocate()" LABEL "POSIX fallocate()"
CONDITION TEST_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 qt_feature("alloca_h" PRIVATE
LABEL "alloca.h" LABEL "alloca.h"
CONDITION TEST_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 "ltcg")
qt_configure_add_summary_entry(ARGS "intelcet") qt_configure_add_summary_entry(ARGS "intelcet")
qt_configure_add_summary_entry( 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 ) CONDITION ( TEST_architecture_arch STREQUAL wasm )
) )
qt_configure_add_summary_section(NAME "Target compiler supports") qt_configure_add_summary_section(NAME "Target compiler supports")