forked from qt-creator/qt-creator
GccToolchain: Also handle compilers named cc and c++
This fixes a common cause for duplicate kits during import: The projects are configured to use one of these compilers, Creator says it can't support them, resulting in a kit without a ToolChain. This in turn will fail the comparison between temporary kits, so the same kit will get created twice. Right after the kit gets created, it gets fixed up again, so the kit seems very sensible after the import is done. Task-number: QTCREATORBUG-22702 Task-number: QTCREATORBUG-20582 Change-Id: I19c8f2e1131818dd9ab86c656001893ec3c083bf Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -1075,9 +1075,11 @@ QList<ToolChain *> GccToolChainFactory::detectForImport(const ToolChainDescripti
|
|||||||
{
|
{
|
||||||
const QString fileName = tcd.compilerPath.toFileInfo().completeBaseName();
|
const QString fileName = tcd.compilerPath.toFileInfo().completeBaseName();
|
||||||
if ((tcd.language == Constants::C_LANGUAGE_ID && (fileName.startsWith("gcc")
|
if ((tcd.language == Constants::C_LANGUAGE_ID && (fileName.startsWith("gcc")
|
||||||
|| fileName.endsWith("gcc")))
|
|| fileName.endsWith("gcc")
|
||||||
|
|| fileName == "cc"))
|
||||||
|| (tcd.language == Constants::CXX_LANGUAGE_ID && (fileName.startsWith("g++")
|
|| (tcd.language == Constants::CXX_LANGUAGE_ID && (fileName.startsWith("g++")
|
||||||
|| fileName.endsWith("g++"))))
|
|| fileName.endsWith("g++")
|
||||||
|
|| fileName == "c++")))
|
||||||
return autoDetectToolChain(tcd, [](const ToolChain *tc) {
|
return autoDetectToolChain(tcd, [](const ToolChain *tc) {
|
||||||
return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor;
|
return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor;
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user