summaryrefslogtreecommitdiffstats
path: root/mkspecs/wasm-emscripten
diff options
context:
space:
mode:
authorMorten Sørvig <morten.sorvig@qt.io>2022-08-09 00:05:33 +0200
committerMorten Sørvig <morten.sorvig@qt.io>2022-08-17 04:52:46 +0200
commitf347682fd52fd8e94f15a06cda9f1a64ebc4d552 (patch)
tree60f93eff464765c130f251eef287b767a4bdcedb /mkspecs/wasm-emscripten
parent238e90cd58433ec79e82325d06fb75d9038b9607 (diff)
wasm: include asyncify support unconditionally
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ø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'mkspecs/wasm-emscripten')
-rw-r--r--mkspecs/wasm-emscripten/qmake.conf6
1 files changed, 3 insertions, 3 deletions
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 \