From 2b0d6a068fcc6723fe3dfd8ac167307f352097ff Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Tue, 25 Jul 2023 16:01:29 +0200 Subject: Support PRELOAD var substitution for WASM main html with qmake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PRELOAD variable in wasm_shell.html wouldn't get substituted with preload list when using qmake. Do that as it is done in cmake. Fixes: QTBUG-115507 Change-Id: I3c659626dc6fa6f4fdf9e31bd62b87fc6a7d8bbe Reviewed-by: Lorn Potter Reviewed-by: Piotr WierciƄski --- mkspecs/features/wasm/wasm.prf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mkspecs/features') diff --git a/mkspecs/features/wasm/wasm.prf b/mkspecs/features/wasm/wasm.prf index 71206ab8cd..4e969aaf5f 100644 --- a/mkspecs/features/wasm/wasm.prf +++ b/mkspecs/features/wasm/wasm.prf @@ -101,11 +101,16 @@ contains(TEMPLATE, .*app) { WASM_PLUGIN_PATH = $$PWD/../../../src/plugins/platforms/wasm } + PRELOAD = "" + shared { + PRELOAD = "preload:\ ['qt_plugins.json',\ 'qt_qml_imports.json']," + } + # Copy/Generate main .html file (e.g. myapp.html) from the webassembly_shell.html by # replacing the app name placeholder with the actual app name. apphtml.name = application main html file apphtml.output = $$DESTDIR/$$TARGET_HTML - apphtml.commands = $$QMAKE_STREAM_EDITOR -e s/@APPNAME@/$$TARGET_BASE/g -e s/@APPEXPORTNAME@/$$EXPORT_NAME/g $$WASM_PLUGIN_PATH/wasm_shell.html > $$DESTDIR/$$TARGET_HTML + apphtml.commands = $$QMAKE_STREAM_EDITOR -e s/@APPNAME@/$$TARGET_BASE/g -e s/@APPEXPORTNAME@/$$EXPORT_NAME/g -e s/@PRELOAD@/$$PRELOAD/g $$WASM_PLUGIN_PATH/wasm_shell.html > $$DESTDIR/$$TARGET_HTML apphtml.input = $$WASM_PLUGIN_PATH/wasm_shell.html apphtml.depends = $$apphtml.input QMAKE_EXTRA_COMPILERS += apphtml -- cgit v1.2.3