QtSupport: Move qtSoPaths from Android

Also add QT_INSTALL_IMPORTS, which is used in a so-called "copy" of
the code in the QtApplicationManager plugin. More is better in this
case.

Change-Id: Ie705d95a24664d3627875ee0463e83a13b830260
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-08-30 11:09:59 +02:00
parent eec6fbe61a
commit 3d954477a4
3 changed files with 27 additions and 26 deletions

View File

@@ -60,31 +60,6 @@ using namespace ProjectExplorer;
namespace Android {
namespace Internal {
static const char * const qMakeVariables[] = {
"QT_INSTALL_LIBS",
"QT_INSTALL_PLUGINS",
"QT_INSTALL_QML"
};
static QStringList qtSoPaths(QtSupport::BaseQtVersion *qtVersion)
{
if (!qtVersion)
return QStringList();
QSet<QString> paths;
for (uint i = 0; i < sizeof qMakeVariables / sizeof qMakeVariables[0]; ++i) {
QString path = qtVersion->qmakeProperty(qMakeVariables[i]);
if (path.isNull())
continue;
QDirIterator it(path, QStringList("*.so"), QDir::Files, QDirIterator::Subdirectories);
while (it.hasNext()) {
it.next();
paths.insert(it.fileInfo().absolutePath());
}
}
return Utils::toList(paths);
}
static QStringList uniquePaths(const QStringList &files)
{
QSet<QString> paths;
@@ -170,7 +145,8 @@ void AndroidDebugSupport::start()
const ProjectNode *node = target->project()->findNodeForBuildKey(runControl()->buildKey());
QStringList solibSearchPath = getSoLibSearchPath(node);
QStringList extraLibs = getExtraLibs(node);
solibSearchPath.append(qtSoPaths(qtVersion));
if (qtVersion)
solibSearchPath.append(qtVersion->qtSoPaths());
solibSearchPath.append(uniquePaths(extraLibs));
solibSearchPath.append(target->activeBuildConfiguration()->buildDirectory().toString());
solibSearchPath.removeDuplicates();