summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>2013-12-04 10:05:04 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-04 16:01:45 +0100
commit1e71b35d9775b0abc9de0ce051bff400f0f1ba64 (patch)
tree9c56abf93f5cc026618f45b4dddb545b670732f0
parent7649792bf660c59260e6a6d52c575e2a6692e783 (diff)
downloadqttools-1e71b35d9775b0abc9de0ce051bff400f0f1ba64.tar.gz
qttools-1e71b35d9775b0abc9de0ce051bff400f0f1ba64.tar.bz2
qttools-1e71b35d9775b0abc9de0ce051bff400f0f1ba64.zip
androiddeployqt: Add OpenGL dependency to manifest if necessary
In order to filter out devices that do not support OpenGLES 2 in Google Play, we need to report that we depend on it when using Qt Quick or Qt OpenGL. It would have been more generic to add the information to the meta-data in the module, but since we already have the information there, just in the form of forcing the use of the GL plugin, we might as well use that and not complicate the dependency XMLs any further. Task-number: QTBUG-32491 Change-Id: I2af044be010fcd0a8076906de6385701041b9c01 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
-rw-r--r--src/androiddeployqt/main.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp
index e6def623..9d3cf507 100644
--- a/src/androiddeployqt/main.cpp
+++ b/src/androiddeployqt/main.cpp
@@ -850,6 +850,14 @@ bool updateAndroidManifest(Options &options)
fprintf(stdout, " -- Using platform plugin %s\n", qPrintable(plugin));
}
+ bool usesGL = false;
+ foreach (QString localLib, localLibs) {
+ if (localLib.endsWith(QLatin1String("libqtforandroidGL.so"))) {
+ usesGL = true;
+ break;
+ }
+ }
+
QHash<QString, QString> replacements;
replacements[QLatin1String("-- %%INSERT_APP_LIB_NAME%% --")] = QFileInfo(options.applicationBinary).baseName().mid(sizeof("lib") - 1);
replacements[QLatin1String("-- %%INSERT_LOCAL_LIBS%% --")] = localLibs.join(QLatin1Char(':'));
@@ -869,6 +877,9 @@ bool updateAndroidManifest(Options &options)
QString features;
foreach (QString feature, options.features)
features += QString::fromLatin1("<uses-feature android:name=\"%1\" />\n").arg(feature);
+ if (usesGL)
+ features += QStringLiteral("<uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />");
+
replacements[QLatin1String("<!-- %%INSERT_FEATURES -->")] = features;
QString androidManifestPath = options.outputDirectory + QLatin1String("/AndroidManifest.xml");