summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Sørvig <[email protected]>2024-01-24 14:45:36 +0100
committerMorten Sørvig <[email protected]>2024-02-20 17:25:25 +0100
commit34242345790242e8350fc6d49d71f34a7b93e446 (patch)
treec8be0ac8dbaadb9c37280868bb76c97c64dc4cf8
parent4281495f52c22326ae961849d8ad7362c30168d2 (diff)
wasm: make preload_qml_imports take a source path
This was running qmlimportscanner on ".", which in some cases would recurse down the qt/ symlink in the app build directory (used with dynamic linking on wasm), and find all of the imports from the Qt installation. Make it take a path instead. Users can then provide a path to the QML sources which will be passed to qmlimportscanner Change-Id: Ib5175e5dc1d26875c42f5a3e286314b7d602c9fe Reviewed-by: Piotr Wierciński <[email protected]> Reviewed-by: Lorn Potter <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
-rwxr-xr-xutil/wasm/preload/preload_qml_imports.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/util/wasm/preload/preload_qml_imports.py b/util/wasm/preload/preload_qml_imports.py
index a572f1f0ec1..2f2fc7958f0 100755
--- a/util/wasm/preload/preload_qml_imports.py
+++ b/util/wasm/preload/preload_qml_imports.py
@@ -80,21 +80,20 @@ def extract_preload_files_from_imports(imports):
if __name__ == "__main__":
- if len(sys.argv) != 3:
- print("Usage: python make_qt_symlinks.py <qt-host-path> <qt-wasm-path>")
+ if len(sys.argv) != 4:
+ print("Usage: python preload_qml_imports.py <qml-source-path> <qt-host-path> <qt-wasm-path>")
sys.exit(1)
- qt_host_path = sys.argv[1]
- qt_wasm_path = sys.argv[2]
+ qml_source_path = sys.argv[1]
+ qt_host_path = sys.argv[2]
+ qt_wasm_path = sys.argv[3]
qml_import_path = os.path.join(qt_wasm_path, "qml")
qmlimportsscanner_path = os.path.join(qt_host_path, "libexec/qmlimportscanner")
eprint("runing qmlimportsscanner")
- result = subprocess.run(
- [qmlimportsscanner_path, "-rootPath", ".", "-importPath", qml_import_path],
- stdout=subprocess.PIPE,
- )
+ command = [qmlimportsscanner_path, "-rootPath", qml_source_path, "-importPath", qml_import_path]
+ result = subprocess.run(command, stdout=subprocess.PIPE)
imports = json.loads(result.stdout)
preload_files = []