Commit bb4edc33 authored by Christian Kandeler's avatar Christian Kandeler

Toolchain support: Better detection of cross-compilers

For instance, executables like arm-linux-gnueabihf-g++ or x86_64-w64-
mingw32-g++ are now detected as gcc and mingw toolchains, respectively.

Change-Id: Ia0884215969ae66613cc709bf02fcf32a67da207
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent b5c482a9
......@@ -928,8 +928,10 @@ QList<ToolChain *> GccToolChainFactory::autoDetect(const QList<ToolChain *> &alr
QList<ToolChain *> GccToolChainFactory::autoDetect(const FileName &compilerPath, const Core::Id &language)
{
const QString fileName = compilerPath.fileName();
if ((language == Constants::C_LANGUAGE_ID && fileName.startsWith("gcc"))
|| (language == Constants::CXX_LANGUAGE_ID && fileName.startsWith("g++")))
if ((language == Constants::C_LANGUAGE_ID && (fileName.startsWith("gcc")
|| fileName.endsWith("gcc")))
|| (language == Constants::CXX_LANGUAGE_ID && (fileName.startsWith("g++")
|| fileName.endsWith("g++"))))
return autoDetectToolChain(compilerPath, language);
return QList<ToolChain *>();
}
......@@ -1412,8 +1414,10 @@ QList<ToolChain *> MingwToolChainFactory::autoDetect(const FileName &compilerPat
Abi ha = Abi::hostAbi();
ha = Abi(ha.architecture(), Abi::WindowsOS, Abi::WindowsMSysFlavor, Abi::PEFormat, ha.wordWidth());
const QString fileName = compilerPath.fileName();
if ((language == Constants::C_LANGUAGE_ID && fileName.startsWith("gcc"))
|| (language == Constants::CXX_LANGUAGE_ID && fileName.startsWith("g++")))
if ((language == Constants::C_LANGUAGE_ID && (fileName.startsWith("gcc")
|| fileName.endsWith("gcc")))
|| (language == Constants::CXX_LANGUAGE_ID && (fileName.startsWith("g++")
|| fileName.endsWith("g++"))))
return autoDetectToolChain(compilerPath, language, ha);
return QList<ToolChain *>();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment