diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 43b75768f04..e08ba7c8e62 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -558,6 +558,11 @@ function(qt_internal_add_test name) # TODO: Add functionality to specify browser list(APPEND extra_test_args "--browser=chrome") + # We always want to enable asyncify for tests, as some of them use exec + # Optimize for size (-Os), since asyncify tends to make the resulting + # binary very large + target_link_options("${name}" PRIVATE "SHELL:-s ASYNCIFY" "-Os") + # This tells cmake to run the tests with this script, since wasm files can't be # executed directly set_property(TARGET "${name}" PROPERTY CROSSCOMPILING_EMULATOR "emrun") diff --git a/cmake/QtWasmHelpers.cmake b/cmake/QtWasmHelpers.cmake index 7ba7cd893ac..5e42c526a74 100644 --- a/cmake/QtWasmHelpers.cmake +++ b/cmake/QtWasmHelpers.cmake @@ -70,7 +70,6 @@ function (qt_internal_setup_wasm_target_properties wasmTarget) # target_link_options("${wasmTarget}" INTERFACE "SHELL:-s SOCKET_DEBUG") # print out socket,network data transfer if ("QT_EMSCRIPTEN_ASYNCIFY=1" IN_LIST QT_QMAKE_DEVICE_OPTIONS) - # Emscripten recommends building with optimizations when using asyncify # in order to reduce wasm file size, and may also generate broken wasm # (with "wasm validation error: too many locals" type errors) if optimizations