Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
None
-
None
-
None
Description
We’d like to drive WebAssembly shared libraries deployment using the CMake deployment API, using the following workflow:
qt-cmake . -DCMAKE_STAGING_PREFIX=path/to/app-install
ninja install
(See also https://www.qt.io/blog/cmake-deployment-api)
Deployment on WebAssembly consists of detecting which plugins and QML imports the app is using, and then emitting a list of files in json format. That list is then passed to qtloader which downloads the required files on startup. This is currently implemented using python scripts (which call qmlimportscanner etc). See QTBUG-63925 for top-level shared libraries task.
Tasks:
Make “ninja install” work
- The default install location is “RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}”, but we don’t want the “bin/“ suffix
- Currently only the app.js file is installed - app.wasm, qtloader.js, and app.html is missing.
Drive deployment from cmake:
- We would like cmake code to determine plugin dependencies and run qmlimportscanner.
- the current impl in the cmake build uses file(GET_RUNTIME_DEPENDENCIES), which is linux only.
- cmake does generate a list of in-use plugins for linux deploymnt, this could maybe be reused
- Creating wasmdeployqt is maybe not needed, or we can crate a minimal one
- Can we generate then json files directly from cmake code?