Android: use extraPrefixDirs with qmlimportscanner

This will ensure that qmlimportscanner can use the extraPrefixDirs,
when an extra prefix is provided like the case with Conan builds.

Task-number: QTBUG-88519
Change-Id: Idec3916b043822da094973a7e246a6ee4af14c83
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
Assam Boudjelthia 2020-11-19 10:33:33 +02:00
parent 456699da93
commit 4ef3da04c3

View File

@ -1827,8 +1827,18 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/qml"));
if (!rootPath.isEmpty())
importPaths += shellQuote(rootPath);
for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths))
importPaths += shellQuote(qmlImportPath);
for (const QString &prefix : options->extraPrefixDirs)
if (QDir().exists(prefix + QLatin1String("/qml")))
importPaths += shellQuote(prefix + QLatin1String("/qml"));
for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths)) {
if (QDir().exists(qmlImportPath)) {
importPaths += shellQuote(qmlImportPath);
} else {
fprintf(stderr, "Warning: QML import path %s does not exist.\n",
qPrintable(qmlImportPath));
}
}
qmlImportScanner += QLatin1String(" -importPath %1").arg(importPaths.join(QLatin1Char(' ')));
if (options->verbose) {