From 195690973e9e96e38052b170356647ca471d5eb2 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 2 Jul 2020 13:09:09 +0200 Subject: [PATCH] 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 --- src/plugins/projectexplorer/gcctoolchain.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index e1dd253be68..8a85edeadaf 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1075,9 +1075,11 @@ QList GccToolChainFactory::detectForImport(const ToolChainDescripti { const QString fileName = tcd.compilerPath.toFileInfo().completeBaseName(); 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++") - || fileName.endsWith("g++")))) + || fileName.endsWith("g++") + || fileName == "c++"))) return autoDetectToolChain(tcd, [](const ToolChain *tc) { return tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor; });