diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2020-07-02 13:09:09 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2020-07-03 11:28:30 +0000 |
commit | 195690973e9e96e38052b170356647ca471d5eb2 (patch) | |
tree | a0f6419aef273f80f559a67240a0f875024f371b /src/plugins/projectexplorer | |
parent | b077a4b845320facb7d713c52c77bf091bc2a0aa (diff) |
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>
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r-- | src/plugins/projectexplorer/gcctoolchain.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index e1dd253be6..8a85edeada 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1075,9 +1075,11 @@ QList<ToolChain *> 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; }); |