forked from qt-creator/qt-creator
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 <vikas.pachdha@qt.io>
This commit is contained in:
@@ -451,6 +451,8 @@ AndroidToolChainFactory::autodetectToolChainsForNdk(const FileName &ndkPath,
|
|||||||
QList<AndroidToolChain *> toolChainBundle;
|
QList<AndroidToolChain *> toolChainBundle;
|
||||||
for (Core::Id lang : {ProjectExplorer::Constants::CXX_LANGUAGE_ID, ProjectExplorer::Constants::C_LANGUAGE_ID}) {
|
for (Core::Id lang : {ProjectExplorer::Constants::CXX_LANGUAGE_ID, ProjectExplorer::Constants::C_LANGUAGE_ID}) {
|
||||||
FileName compilerPath = AndroidConfigurations::currentConfig().gccPath(abi, lang, version);
|
FileName compilerPath = AndroidConfigurations::currentConfig().gccPath(abi, lang, version);
|
||||||
|
if (!compilerPath.exists())
|
||||||
|
continue;
|
||||||
|
|
||||||
AndroidToolChain *tc = findToolChain(compilerPath, lang, alreadyKnown);
|
AndroidToolChain *tc = findToolChain(compilerPath, lang, alreadyKnown);
|
||||||
if (!tc || tc->originalTargetTriple().isEmpty()) {
|
if (!tc || tc->originalTargetTriple().isEmpty()) {
|
||||||
@@ -464,7 +466,8 @@ AndroidToolChainFactory::autodetectToolChainsForNdk(const FileName &ndkPath,
|
|||||||
toolChainBundle.append(tc);
|
toolChainBundle.append(tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
QTC_ASSERT(!toolChainBundle.isEmpty(), continue);
|
if (toolChainBundle.isEmpty())
|
||||||
|
continue;
|
||||||
|
|
||||||
auto it = newestToolChainForArch.constFind(abi);
|
auto it = newestToolChainForArch.constFind(abi);
|
||||||
if (it == newestToolChainForArch.constEnd())
|
if (it == newestToolChainForArch.constEnd())
|
||||||
|
|||||||
Reference in New Issue
Block a user