From 6b701ec6f097faf253b2f0b556e96e76d135b060 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 10 Jul 2018 23:14:08 +0300 Subject: [PATCH] Utils: Follow symlinks in Environment::isSameExecutable If qmake uses /usr/bin/gcc and the kit is configured to use /usr/bin/gcc-7, and both reference the same executable, there is no reason to warn. Change-Id: Ida79fccb97cffb682c1d85d7fa8888d85bf7d6a4 Reviewed-by: Eike Ziller Reviewed-by: Tobias Hunger --- src/libs/utils/environment.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index c3b0f13f7c6..e8e8938739e 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -447,7 +447,11 @@ bool Environment::isSameExecutable(const QString &exe1, const QString &exe2) con const QStringList exe2List = appendExeExtensions(exe2); for (const QString &i1 : exe1List) { for (const QString &i2 : exe2List) { - if (FileName::fromString(i1) == FileName::fromString(i2)) + const FileName f1 = FileName::fromString(i1); + const FileName f2 = FileName::fromString(i2); + if (f1 == f2) + return true; + if (FileUtils::resolveSymlinks(f1) == FileUtils::resolveSymlinks(f2)) return true; } }