forked from qt-creator/qt-creator
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:
@@ -840,11 +840,23 @@ QStringList AndroidConfig::getAbis(const QString &device)
|
|||||||
bool AndroidConfig::isValidNdk(const QString &ndkLocation) const
|
bool AndroidConfig::isValidNdk(const QString &ndkLocation) const
|
||||||
{
|
{
|
||||||
auto ndkPath = Utils::FilePath::fromUserInput(ndkLocation);
|
auto ndkPath = Utils::FilePath::fromUserInput(ndkLocation);
|
||||||
const FilePath ndkPlatformsDir = ndkPath.pathAppended("platforms");
|
|
||||||
|
|
||||||
return ndkPath.exists() && ndkPath.pathAppended("toolchains").exists()
|
if (!ndkPath.exists())
|
||||||
&& ndkPlatformsDir.exists() && !ndkPlatformsDir.toString().contains(' ')
|
return false;
|
||||||
&& !ndkVersion(ndkPath).isNull();
|
|
||||||
|
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
|
QString AndroidConfig::bestNdkPlatformMatch(int target, const BaseQtVersion *qtVersion) const
|
||||||
|
Reference in New Issue
Block a user