forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.7'
Conflicts: qtcreator.pri qtcreator.qbs Change-Id: Ie71d0d5aebdd1406d94de348bcd4cfcc203a1ba9
This commit is contained in:
@@ -121,6 +121,10 @@ bool AndroidDeployStep::init()
|
||||
return false;
|
||||
}
|
||||
m_ndkToolChainVersion = static_cast<AndroidToolChain *>(tc)->ndkToolChainVersion();
|
||||
|
||||
QString arch = static_cast<Qt4Project *>(project())->rootQt4ProjectNode()->singleVariableValue(Qt4ProjectManager::AndroidArchVar);
|
||||
if (!arch.isEmpty())
|
||||
m_libgnustl = AndroidManager::libGnuStl(arch, m_ndkToolChainVersion);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -259,14 +263,6 @@ int AndroidDeployStep::deviceAPILevel()
|
||||
return m_deviceAPILevel;
|
||||
}
|
||||
|
||||
Utils::FileName AndroidDeployStep::localLibsRulesFilePath()
|
||||
{
|
||||
Utils::FileName fileName = AndroidManager::localLibsRulesFilePath(target());
|
||||
fileName.append(QLatin1String("/rules.xml"));
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
unsigned int AndroidDeployStep::remoteModificationTime(const QString &fullDestination, QHash<QString, unsigned int> *cache)
|
||||
{
|
||||
QString destination = QFileInfo(fullDestination).absolutePath();
|
||||
@@ -402,6 +398,22 @@ bool AndroidDeployStep::deployPackage()
|
||||
remoteRoot + QLatin1String("/lib"),
|
||||
true,
|
||||
QStringList() << QLatin1String("*.so"));
|
||||
|
||||
// don't use the libgnustl_shared.so from the qt directory
|
||||
for (int i = 0; i < deployList.count(); ++i) {
|
||||
if (deployList.at(i).remoteFileName == QLatin1String("/data/local/tmp/qt/lib/libgnustl_shared.so")) {
|
||||
deployList.removeAt(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// We want to deploy that *always*
|
||||
// since even if the timestamps did not change, the toolchain might have changed
|
||||
// leading to a different file
|
||||
deployList.append(DeployItem(m_libgnustl,
|
||||
QDateTime::currentDateTimeUtc().toTime_t(),
|
||||
QLatin1String("/data/local/tmp/qt/lib/libgnustl_shared.so"), false));
|
||||
|
||||
collectFiles(&deployList,
|
||||
m_qtVersionSourcePath + QLatin1String("/plugins"),
|
||||
remoteRoot + QLatin1String("/plugins"),
|
||||
|
||||
@@ -87,7 +87,6 @@ public:
|
||||
|
||||
QString deviceSerialNumber();
|
||||
int deviceAPILevel();
|
||||
Utils::FileName localLibsRulesFilePath();
|
||||
|
||||
AndroidDeployAction deployAction();
|
||||
bool useLocalQtLibs();
|
||||
@@ -154,7 +153,7 @@ private:
|
||||
QString m_runQASIPackagePath;
|
||||
AndroidDeployAction m_runDeployAction;
|
||||
QString m_ndkToolChainVersion;
|
||||
|
||||
QString m_libgnustl;
|
||||
static const Core::Id Id;
|
||||
};
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ AndroidDeployStepWidget::AndroidDeployStepWidget(AndroidDeployStep *step) :
|
||||
connect(ui->deployQtLibs, SIGNAL(clicked()), SLOT(setDeployLocalQtLibs()));
|
||||
connect(ui->chooseButton, SIGNAL(clicked()), SLOT(setQASIPackagePath()));
|
||||
connect(ui->useLocalQtLibs, SIGNAL(stateChanged(int)), SLOT(useLocalQtLibsStateChanged(int)));
|
||||
connect(ui->editRulesFilePushButton, SIGNAL(clicked()), SLOT(editRulesFile()));
|
||||
connect(ui->cleanLibsPushButton, SIGNAL(clicked()), SLOT(cleanLibsOnDevice()));
|
||||
}
|
||||
|
||||
@@ -106,11 +105,6 @@ void AndroidDeployStepWidget::useLocalQtLibsStateChanged(int state)
|
||||
m_step->setUseLocalQtLibs(state == Qt::Checked);
|
||||
}
|
||||
|
||||
void AndroidDeployStepWidget::editRulesFile()
|
||||
{
|
||||
Core::ICore::instance()->openFiles(QStringList() << m_step->localLibsRulesFilePath().toString(), Core::ICore::SwitchMode);
|
||||
}
|
||||
|
||||
void AndroidDeployStepWidget::cleanLibsOnDevice()
|
||||
{
|
||||
m_step->cleanLibsOnDevice();
|
||||
|
||||
@@ -53,7 +53,6 @@ private slots:
|
||||
void setDeployLocalQtLibs();
|
||||
void setQASIPackagePath();
|
||||
void useLocalQtLibsStateChanged(int);
|
||||
void editRulesFile();
|
||||
void cleanLibsOnDevice();
|
||||
|
||||
private:
|
||||
|
||||
@@ -63,13 +63,6 @@ You must have Qt libraries compiled for that platform</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="editRulesFilePushButton">
|
||||
<property name="text">
|
||||
<string>Edit Rules File</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
|
||||
@@ -585,7 +585,12 @@ QStringList AndroidManager::availableQtLibs(ProjectExplorer::Target *target)
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target->kit());
|
||||
if (tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE))
|
||||
return QStringList();
|
||||
|
||||
Qt4ProjectManager::Qt4Project *project = static_cast<Qt4ProjectManager::Qt4Project *>(target->project());
|
||||
QString arch = project->rootQt4ProjectNode()->singleVariableValue(Qt4ProjectManager::AndroidArchVar);
|
||||
|
||||
AndroidToolChain *atc = static_cast<AndroidToolChain *>(tc);
|
||||
QString libgnustl = libGnuStl(arch, atc->ndkToolChainVersion());
|
||||
|
||||
Utils::FileName readelfPath = AndroidConfigurations::instance().readelfPath(target->activeRunConfiguration()->abi().architecture(),
|
||||
atc->ndkToolChainVersion());
|
||||
@@ -613,6 +618,9 @@ QStringList AndroidManager::availableQtLibs(ProjectExplorer::Target *target)
|
||||
mapLibs[library].dependencies = dependencies(readelfPath, libPath.absolutePath());
|
||||
}
|
||||
|
||||
const QString library = libgnustl.mid(libgnustl.lastIndexOf(QLatin1Char('/')) + 1);
|
||||
mapLibs[library] = Library();;
|
||||
|
||||
// clean dependencies
|
||||
foreach (const QString &key, mapLibs.keys()) {
|
||||
int it = 0;
|
||||
@@ -950,5 +958,14 @@ bool AndroidManager::qtLibrariesLessThan(const Library &a, const Library &b)
|
||||
return a.level < b.level;
|
||||
}
|
||||
|
||||
QString AndroidManager::libGnuStl(const QString &arch, const QString &ndkToolChainVersion)
|
||||
{
|
||||
return AndroidConfigurations::instance().config().ndkLocation.toString()
|
||||
+ QLatin1String("/sources/cxx-stl/gnu-libstdc++/")
|
||||
+ ndkToolChainVersion + QLatin1String("/libs/")
|
||||
+ arch
|
||||
+ QLatin1String("/libgnustl_shared.so");
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
@@ -112,6 +112,8 @@ public:
|
||||
static QStringList prebundledLibs(ProjectExplorer::Target *target);
|
||||
static bool setPrebundledLibs(ProjectExplorer::Target *target, const QStringList &libs);
|
||||
|
||||
static QString libGnuStl(const QString &arch, const QString &ndkToolChainVersion);
|
||||
|
||||
private:
|
||||
static void raiseError(const QString &reason);
|
||||
static bool openXmlFile(QDomDocument &doc, const Utils::FileName &fileName);
|
||||
|
||||
Reference in New Issue
Block a user