Android: Set ANDROID_EXTRA_LIBS scoped to the arch

The workflow for adding a library for multiple archs is not ideal, but
now a little better. The user has to go to the deploy setting for a
kit per architecture and add the right extra library.

Change-Id: I2bda6961f6f1164bdc58acd78fa3d2221977f0cf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Daniel Teske
2014-03-07 12:56:59 +01:00
parent 43579c9bc6
commit 765ad6c3d2
8 changed files with 64 additions and 14 deletions

View File

@@ -31,6 +31,7 @@
#include "androidextralibrarylistmodel.h"
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <proparser/prowriter.h>
using namespace Android;
using namespace Internal;
@@ -83,6 +84,10 @@ void AndroidExtraLibraryListModel::proFileUpdated(QmakeProjectManager::QmakeProF
if (node != root)
return;
m_scope = QLatin1String("contains(ANDROID_TARGET_ARCH,")
+ node->singleVariableValue(QmakeProjectManager::AndroidArchVar)
+ QLatin1Char(')');
if (parseInProgress) {
emit enabledChanged(false);
return;
@@ -124,7 +129,9 @@ void AndroidExtraLibraryListModel::addEntries(const QStringList &list)
m_entries += QDir(m_project->projectDirectory()).relativeFilePath(path);
QmakeProjectManager::QmakeProFileNode *node = m_project->rootQmakeProjectNode();
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries.join(QLatin1String(" ")));
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries, m_scope,
QmakeProjectManager::Internal::ProWriter::ReplaceValues
| QmakeProjectManager::Internal::ProWriter::MultiLine);
endInsertRows();
}
@@ -156,5 +163,5 @@ void AndroidExtraLibraryListModel::removeEntries(QModelIndexList list)
}
QmakeProjectManager::QmakeProFileNode *node = m_project->rootQmakeProjectNode();
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries.join(QLatin1String(" ")));
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries, m_scope);
}