Android: fix toolchain path retrieval for NDK r10

Although, recent Qt versions (Qt 5.12+) don't really need r10, this
can be useful if an older version is used, or if the user wants to
explicitly use Ndk r10.

Change-Id: Ic88929a747bcea89384a7bae9d8f8b26135fae65
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Assam Boudjelthia
2021-08-21 15:48:43 +03:00
parent 7b688bfd12
commit bf3dae64a2

View File

@@ -473,7 +473,13 @@ FilePath AndroidConfig::avdManagerToolPath() const
FilePath AndroidConfig::toolchainPathFromNdk(const Utils::FilePath &ndkLocation) const
{
const FilePath toolchainPath = ndkLocation / "toolchains/llvm/prebuilt/";
const FilePath tcPath = ndkLocation / "toolchains/";
FilePath toolchainPath;
QDirIterator llvmIter(tcPath.toString(), {"llvm*"}, QDir::Dirs);
if (llvmIter.hasNext()) {
llvmIter.next();
toolchainPath = tcPath / llvmIter.fileName() / "prebuilt/";
}
// detect toolchain host
QStringList hostPatterns;