Android: fix manual deployment with ANDROID_DEPLOYMENT_DEPENDENCIES

Fix the qtforandroid (i.e. libplugins_platforms_qtforandroid) check
and avoid calling llvm-readobj on non-library files and only add them
to the dependency list.

Task-number: QTBUG-94232
Change-Id: Id1a415b6d9834daaf5337e9bd15e7daf69fd574f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 4521dfe75ad147fc5510702b33189dd2faed93fd)
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
This commit is contained in:
Assam Boudjelthia 2023-03-21 21:22:13 +02:00
parent 000d3d5908
commit 8491d03d3f

View File

@ -1109,6 +1109,7 @@ bool readInputFile(Options *options)
}
}
} else {
if (dependency.endsWith(QLatin1String(".so"))) {
auto arch = fileArchitecture(*options, path);
if (!arch.isEmpty()) {
options->qtDependencies[arch].append(QtDependency(dependency.toString(), path));
@ -1116,6 +1117,10 @@ bool readInputFile(Options *options)
fprintf(stderr, "Skipping \"%s\", unknown architecture\n", qPrintable(path));
fflush(stderr);
}
} else {
for (auto arch : options->architectures.keys())
options->qtDependencies[arch].append(QtDependency(dependency.toString(), path));
}
}
}
}
@ -1422,7 +1427,7 @@ bool updateLibsXml(Options *options)
if (localLibs.isEmpty()) {
QString plugin;
for (const QtDependency &qtDependency : options->qtDependencies[it.key()]) {
if (qtDependency.relativePath.endsWith(QLatin1String("libqtforandroid.so")))
if (qtDependency.relativePath.contains(QLatin1String("libplugins_platforms_qtforandroid_")))
plugin = qtDependency.relativePath;
if (qtDependency.relativePath.contains(
@ -1435,8 +1440,8 @@ bool updateLibsXml(Options *options)
if (plugin.isEmpty()) {
fflush(stdout);
fprintf(stderr, "No platform plugin (libqtforandroid.so) included in "
"the deployment. Make sure the app links to Qt Gui library.\n");
fprintf(stderr, "No platform plugin (libplugins_platforms_qtforandroid.so) included"
" in the deployment. Make sure the app links to Qt Gui library.\n");
fflush(stderr);
return false;
}