Support PRELOAD var substitution for WASM main html with qmake

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 <lorn.potter@gmail.com>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 2b0d6a068f)
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Mikolaj Boc 2023-07-25 16:01:29 +02:00 committed by Morten Sørvig
parent 8d96533c42
commit 0136720e52

View File

@ -92,11 +92,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 $$WASM_PLUGIN_PATH/wasm_shell.html > $$DESTDIR/$$TARGET_HTML
apphtml.commands = $$QMAKE_STREAM_EDITOR -e s/@APPNAME@/$$TARGET_BASE/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