From 5bf9ac7d56ac2d92afbf6fa80729a7e7b55de8ce Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 12 Oct 2018 14:34:38 +0200 Subject: [PATCH] Android: Prevent invalid assertions in toolchain detection code NDK r17 removed the MIPS toolchains, but kept the respective directories, which was enough for us to assume the compiler binaries were also present. Instead, we now explicitly check for the presence of the compiler binaries. Change-Id: Ice68cf497a66f5e8b900e29634a988547fdee0d8 Reviewed-by: Vikas Pachdha --- src/plugins/android/androidtoolchain.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 7b32e5be69c..4ab1f4f0cca 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -451,6 +451,8 @@ AndroidToolChainFactory::autodetectToolChainsForNdk(const FileName &ndkPath, QList toolChainBundle; for (Core::Id lang : {ProjectExplorer::Constants::CXX_LANGUAGE_ID, ProjectExplorer::Constants::C_LANGUAGE_ID}) { FileName compilerPath = AndroidConfigurations::currentConfig().gccPath(abi, lang, version); + if (!compilerPath.exists()) + continue; AndroidToolChain *tc = findToolChain(compilerPath, lang, alreadyKnown); if (!tc || tc->originalTargetTriple().isEmpty()) { @@ -464,7 +466,8 @@ AndroidToolChainFactory::autodetectToolChainsForNdk(const FileName &ndkPath, toolChainBundle.append(tc); } - QTC_ASSERT(!toolChainBundle.isEmpty(), continue); + if (toolChainBundle.isEmpty()) + continue; auto it = newestToolChainForArch.constFind(abi); if (it == newestToolChainForArch.constEnd())