From f347682fd52fd8e94f15a06cda9f1a64ebc4d552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Tue, 9 Aug 2022 00:05:33 +0200 Subject: wasm: include asyncify support unconditionally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Emscripten's option for enabling asyncify (-sASYNCIFY) is a link-time option, which means there is no requirement to have a separate asyncify build, at least for static builds. Replace the current QT_HAVE_EMSCRIPTEN_ASYNCIFY compile-time option with a run-time option which checks if the asyncify API is available. Keep support for configuring with "-device-option QT_EMSCRIPTEN_ASYNCIFY=1" for backwards compatibility and for the use case where want asyncify support to be on by default for a given Qt build. Enable asyncify for the asyncify_exec example. Pick-to: 6.4 Change-Id: I301fd7e2d3c0367532c886f4e34b23e1093646ad Reviewed-by: Tor Arne Vestbø --- tests/manual/wasm/eventloop/asyncify_exec/main.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'tests/manual/wasm/eventloop/asyncify_exec/main.cpp') diff --git a/tests/manual/wasm/eventloop/asyncify_exec/main.cpp b/tests/manual/wasm/eventloop/asyncify_exec/main.cpp index c3a827ac115..ab3018c12ec 100644 --- a/tests/manual/wasm/eventloop/asyncify_exec/main.cpp +++ b/tests/manual/wasm/eventloop/asyncify_exec/main.cpp @@ -2,14 +2,12 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #include -// This test shows how to asyncify enables blocking -// the main thread on QEventLoop::exec(), while event -// provessing continues. +// This test shows how to use asyncify to enable blocking the main +// thread on QEventLoop::exec(), while event processing continues. int main(int argc, char **argv) { QCoreApplication app(argc, argv); -#ifdef QT_HAVE_EMSCRIPTEN_ASYNCIFY QTimer::singleShot(1000, []() { QEventLoop loop; @@ -22,10 +20,6 @@ int main(int argc, char **argv) loop.exec(); qDebug() << "Returned from QEventLoop::exec()"; }); -#else - qDebug() << "This test requires Emscripten asyncify. To enable," - << "configure Qt with -device-option QT_EMSCRIPTEN_ASYNCIFY=1"; -#endif app.exec(); } -- cgit v1.2.3