diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-09-08 16:18:34 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-09-09 15:40:40 +0200 |
commit | 2f583eeab254edbb0e1b42213e9d48ce6ad3f04e (patch) | |
tree | 5b2065196d1f566ab496e909e50e20fa07ab3d42 /tools/qmlcachegen/qmlcachegen.cpp | |
parent | 3a35b57269519bfed2418e27ed9daf69f27576a0 (diff) |
Add --bare option to qmltc and qmlcachegen
We need those to prevent usage of the host Qt's import path when
building QML files for the target.
Task-number: QTBUG-106365
Pick-to: 6.4 6.4.0
Change-Id: I34499af850fb759603206cb429ff97633c76054d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tools/qmlcachegen/qmlcachegen.cpp')
-rw-r--r-- | tools/qmlcachegen/qmlcachegen.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp index fccc107c7a..e5af2f8bae 100644 --- a/tools/qmlcachegen/qmlcachegen.cpp +++ b/tools/qmlcachegen/qmlcachegen.cpp @@ -66,6 +66,8 @@ int main(int argc, char **argv) parser.addHelpOption(); parser.addVersionOption(); + QCommandLineOption bareOption(QStringLiteral("bare"), QCoreApplication::translate("main", "Do not include default import directories. This may be used to run qmlcachegen on a project using a different Qt version.")); + parser.addOption(bareOption); QCommandLineOption filterResourceFileOption(QStringLiteral("filter-resource-file"), QCoreApplication::translate("main", "Filter out QML/JS files from a resource file that can be cached ahead of time instead")); parser.addOption(filterResourceFileOption); QCommandLineOption resourceFileMappingOption(QStringLiteral("resource-file-mapping"), QCoreApplication::translate("main", "Path from original resource file to new one"), QCoreApplication::translate("main", "old-name=new-name")); @@ -234,7 +236,8 @@ int main(int argc, char **argv) if (parser.isSet(importPathOption)) importPaths = parser.values(importPathOption); - importPaths.append(QLibraryInfo::path(QLibraryInfo::QmlImportsPath)); + if (!parser.isSet(bareOption)) + importPaths.append(QLibraryInfo::path(QLibraryInfo::QmlImportsPath)); QQmlJSImporter importer( importPaths, parser.isSet(resourceOption) ? &fileMapper : nullptr); |