From 4ae5516453e86b64326e61b14603ed1508aeb319 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 11 Dec 2020 16:41:46 +0100 Subject: [PATCH] CMakeProjectManager: Use canonical paths for compiler match import On Linux (Ubuntu 20.04) Qt Creator would use /usr/bin/g++ as compiler for C++. CMake would pick /usr/bin/c++ as C++ compiler. Both of them are symlinks to /usr/bin/x86_64-linux-gnu-g++-9 There is no need to create imported kits for something which is the same compiler. Fixes: QTCREATORBUG-25069 Change-Id: I90e0f7b1977ace3f7995ce09f4b3fcfa64d02b72 Reviewed-by: Alessandro Portale --- src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 916df2cd886..123d1aee73a 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -324,7 +324,7 @@ bool CMakeProjectImporter::matchKit(void *directoryData, const Kit *k) const if (!Utils::contains(allLanguages, [&tcd](const Id& language) {return language == tcd.language;})) continue; ToolChain *tc = ToolChainKitAspect::toolChain(k, tcd.language); - if (!tc || tc->compilerCommand() != tcd.compilerPath) + if (!tc || tc->compilerCommand().canonicalPath() != tcd.compilerPath.canonicalPath()) return false; }