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ø --- mkspecs/wasm-emscripten/qmake.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mkspecs/wasm-emscripten') diff --git a/mkspecs/wasm-emscripten/qmake.conf b/mkspecs/wasm-emscripten/qmake.conf index 648246b268..6bb99d49b6 100644 --- a/mkspecs/wasm-emscripten/qmake.conf +++ b/mkspecs/wasm-emscripten/qmake.conf @@ -22,12 +22,12 @@ load(emcc_ver) # (with "wasm validation error: too many locals" type errors) if optimizations # are omitted. Enable optimizations also for debug builds. QMAKE_LFLAGS_DEBUG += -Os - - # Declare all async functions - QMAKE_LFLAGS += -s \'ASYNCIFY_IMPORTS=[\"qt_asyncify_suspend_js\", \"qt_asyncify_resume_js\", \"emscripten_sleep\"]\' } } +# Declare async functions +QMAKE_LFLAGS += -s \'ASYNCIFY_IMPORTS=qt_asyncify_suspend_js,qt_asyncify_resume_js\' + EMCC_COMMON_LFLAGS += \ -s WASM=1 \ -s MAX_WEBGL_VERSION=2 \ -- cgit v1.2.3