From 22dda4f8a55b28e1220efb97ead4de9b78d103bb Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 23 Feb 2022 08:43:58 +0100 Subject: [PATCH] ProjectExplorer: only use local files for size comparison Change-Id: Ifbf218d4e459462ec6a115e69a5f3688642fddda Reviewed-by: Christian Stenger Reviewed-by: hjk --- src/plugins/projectexplorer/gcctoolchain.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 155a2e2eec4..a485f74896a 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1194,10 +1194,16 @@ Toolchains GccToolChainFactory::autoDetectToolchains( || compilerPath.toString().contains("ccache")) { existingTcMatches = existingCommand == compilerPath; } else { - existingTcMatches = Environment::systemEnvironment().isSameExecutable( - existingCommand.toString(), compilerPath.toString()) - || (HostOsInfo::isWindowsHost() && existingCommand.toFileInfo().size() - == compilerPath.toFileInfo().size()); + existingTcMatches = Environment::systemEnvironment() + .isSameExecutable(existingCommand.toString(), + compilerPath.toString()); + if (!existingTcMatches + && HostOsInfo::isWindowsHost() + && !existingCommand.needsDevice() + && !compilerPath.needsDevice()) { + existingTcMatches = existingCommand.toFileInfo().size() + == compilerPath.toFileInfo().size(); + } } if (existingTcMatches) { if (existingTc->typeId() == requiredTypeId && (!checker || checker(existingTc))