wasm: add configure option for asyncify JSPI

Make this a proper Qt configure feature: 

 -feature-wasm-jspi

Using the JSPI name matches the updated Emscripten naming
as well, which as moved from "asyncify 2".

Task-number: QTBUG-129748
Change-Id: Idfc372f831d1db5c79109c97a00e30e58713f9f6
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
This commit is contained in:
Morten Sørvig 2024-11-26 15:38:12 +01:00
parent 00ef435571
commit 92ad0f1f01
2 changed files with 13 additions and 1 deletions

View File

@ -82,7 +82,7 @@ function (qt_internal_setup_wasm_target_properties wasmTarget)
target_link_options("${wasmTarget}" INTERFACE "SHELL:-s ASYNCIFY" "-Os")
target_compile_definitions("${wasmTarget}" INTERFACE QT_HAVE_EMSCRIPTEN_ASYNCIFY)
elseif ("QT_EMSCRIPTEN_ASYNCIFY=2" IN_LIST QT_QMAKE_DEVICE_OPTIONS)
elseif ("QT_EMSCRIPTEN_ASYNCIFY=2" IN_LIST QT_QMAKE_DEVICE_OPTIONS OR QT_FEATURE_wasm_jspi)
# Enable JSPI (also known as asyncify 2). Unlike asyncify 1 this
# is supported natively by the browsers, and does not require
# enabling optimizations.

View File

@ -984,6 +984,14 @@ qt_feature("wasm-exceptions" PUBLIC
qt_feature_definition("wasm-exceptions" "QT_WASM_EXCEPTIONS" VALUE "1")
qt_feature_config("wasm-exceptions" QMAKE_PRIVATE_CONFIG)
qt_feature("wasm-jspi" PUBLIC
LABEL "WebAssembly JSPI"
PURPOSE "Enables WebAssembly JavaScript Promise Integration (JSPI)"
AUTODETECT OFF
)
qt_feature_definition("wasm-jspi" "QT_WASM_JSPI" VALUE "1")
qt_feature_config("wasm-jspi" QMAKE_PRIVATE_CONFIG)
qt_feature("localtime_r" PRIVATE
LABEL "localtime_r()"
CONDITION TEST_localtime_r
@ -1314,6 +1322,10 @@ qt_configure_add_summary_entry(
ARGS "wasm-exceptions"
CONDITION ( TEST_architecture_arch STREQUAL wasm )
)
qt_configure_add_summary_entry(
ARGS "wasm-jspi"
CONDITION ( TEST_architecture_arch STREQUAL wasm )
)
qt_configure_add_summary_section(NAME "Target compiler supports")
qt_configure_add_summary_entry(
TYPE "featureList"