androiddeployqt: Only pass qt_install_dir/qml directory if it exists
In Conan's case, the qtbase installed package directory lacks a qml directory. We pass that as a valid qml import path via CMake -> deployment json file -> androiddeployqt -> qmlimportscanner which causes the qmlimportscanner to fail with qmlimportscanner: No such file or directory: "~/package/some_sha_1/qml" Invalid json output from qmlimportscanner. which in turn fails the androiddeploqt build step. Make sure to only pass qtbase_install_dir/qml if it actually exists. Amendsbb104ef3da04c3Amendsc08b9a49baPick-to: 6.2 6.3 6.4 Fixes: QTBUG-104056 Task-number: QTBUG-88519 Task-number: QTBUG-89588 Change-Id: I4310eb4e265ae8d3e3f09e1e1dbed79210e23de6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
parent
b3d0325a8d
commit
0c82f98ec5
|
|
@ -1946,12 +1946,22 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
|
|||
}
|
||||
|
||||
QStringList importPaths;
|
||||
importPaths += shellQuote(options->qtInstallDirectory + "/qml"_L1);
|
||||
|
||||
// In Conan's case, qtInstallDirectory will point only to qtbase installed files, which
|
||||
// lacks a qml directory. We don't want to pass it as an import path if it doesn't exist
|
||||
// because it will cause qmlimportscanner to fail.
|
||||
// This also covers the case when only qtbase is installed in a regular Qt build.
|
||||
const QString mainImportPath = options->qtInstallDirectory + "/qml"_L1;
|
||||
if (QDir().exists(mainImportPath))
|
||||
importPaths += shellQuote(mainImportPath);
|
||||
|
||||
// These are usually provided by CMake in the deployment json file from paths specified
|
||||
// in CMAKE_FIND_ROOT_PATH. They might not have qml modules.
|
||||
for (const QString &prefix : options->extraPrefixDirs)
|
||||
if (QDir().exists(prefix + "/qml"_L1))
|
||||
importPaths += shellQuote(prefix + "/qml"_L1);
|
||||
|
||||
// These are provided by both CMake and qmake.
|
||||
for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths)) {
|
||||
if (QDir().exists(qmlImportPath)) {
|
||||
importPaths += shellQuote(qmlImportPath);
|
||||
|
|
|
|||
Loading…
Reference in New Issue