Android: Enable manual adding of NDKs v22+

Don't enforce the presence of a "platforms" subdirectory if the NDK is
of version 22 or higher. The last NDK version with that directory is 21.

Change-Id: Ib431e7db4521533206304d252dcf93b7ea6169e5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Alessandro Portale
2021-11-01 17:19:43 +01:00
parent b6228eb182
commit 0de09fe3a3

View File

@@ -840,11 +840,23 @@ QStringList AndroidConfig::getAbis(const QString &device)
bool AndroidConfig::isValidNdk(const QString &ndkLocation) const
{
auto ndkPath = Utils::FilePath::fromUserInput(ndkLocation);
const FilePath ndkPlatformsDir = ndkPath.pathAppended("platforms");
return ndkPath.exists() && ndkPath.pathAppended("toolchains").exists()
&& ndkPlatformsDir.exists() && !ndkPlatformsDir.toString().contains(' ')
&& !ndkVersion(ndkPath).isNull();
if (!ndkPath.exists())
return false;
if (!ndkPath.pathAppended("toolchains").exists())
return false;
const QVersionNumber version = ndkVersion(ndkPath);
if (ndkVersion(ndkPath).isNull())
return false;
const FilePath ndkPlatformsDir = ndkPath.pathAppended("platforms");
if (version.majorVersion() <= 22
&& (!ndkPlatformsDir.exists() || ndkPlatformsDir.toString().contains(' ')))
return false; // TODO: Adapt code that assumes the presence of a "platforms" folder
return true;
}
QString AndroidConfig::bestNdkPlatformMatch(int target, const BaseQtVersion *qtVersion) const