From f6ac2c8e751c8b0f62cd9cd9c481c9d0ca6543b0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 21 May 2019 10:56:30 +0200 Subject: [PATCH] ProjectExplorer: Improve "same file" detection for toolchains Only use the file size heuristic on Windows, as it actually helps us filter out duplicates there. On Unix, there is no such compensation for the risk of false positives. For instance, on my Linux machine, i686-w64-mingw32-gcc and x86_64-w64- mingw32-gcc have the same file size, but they are not the same file. Change-Id: I427d2ff36a33ffb045c71851c91312e129616f69 Reviewed-by: hjk Reviewed-by: Orgad Shaneh --- src/plugins/projectexplorer/gcctoolchain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 912d7d53812..24ff830d5c6 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -967,7 +967,8 @@ QList GccToolChainFactory::autoDetectToolchains( } else { existingTcMatches = Environment::systemEnvironment().isSameExecutable( existingCommand.toString(), compilerPath.toString()) - || existingCommand.toFileInfo().size() == compilerPath.toFileInfo().size(); + || (HostOsInfo::isWindowsHost() && existingCommand.toFileInfo().size() + == compilerPath.toFileInfo().size()); } if (existingTcMatches) { if (!result.contains(existingTc))