diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-11-22 17:01:12 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-11-28 10:16:43 +0000 |
commit | bdb4d05b3a2f88279d344ee4371ebbf77fdc6d15 (patch) | |
tree | 1667022fb642c81a3f1b6ee2a0bbc245f00ac149 | |
parent | da9f7526d9004bd0385d9fbfad6d7b63271cd607 (diff) |
Qt.android_support: Fix check for finding the main binary
Libraries from the app product should get higher precedence than those
from dependencies.
Change-Id: Id8bf723fd09e7a798e554f4dbaaae3c73815c1d4
Reviewed-by: Erik Schilling <ablu.erikschilling@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | src/lib/qtprofilesetup/templates/android_support.qbs | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/qtprofilesetup/templates/android_support.qbs b/src/lib/qtprofilesetup/templates/android_support.qbs index c4c4a51f0..79276a494 100644 --- a/src/lib/qtprofilesetup/templates/android_support.qbs +++ b/src/lib/qtprofilesetup/templates/android_support.qbs @@ -60,15 +60,25 @@ Module { } else { for (i = 0; i < nativeLibs.length; ++i) { var candidate = nativeLibs[i]; - if (candidate.fileName.contains(candidate.product.targetName)) { - if (theBinary) { - throw "Qt applications for Android support only one native binary " - + "per package.\n" - + "In particular, you cannot build a Qt app for more than " - + "one architecture at the same time."; - } + if (!candidate.fileName.contains(candidate.product.targetName)) + continue; + if (!theBinary) { theBinary = candidate; + continue; } + if (theBinary.product.name === product.name + && candidate.product.name !== product.name) { + continue; // We already have a better match. + } + if (candidate.product.name === product.name + && theBinary.product.name !== product.name) { + theBinary = candidate; // The new candidate is a better match. + continue; + } + throw "Qt applications for Android support only one native binary " + + "per package.\n" + + "In particular, you cannot build a Qt app for more than " + + "one architecture at the same time."; } } var f = new TextFile(output.filePath, TextFile.WriteOnly); |