diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2018-07-10 23:14:08 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2018-07-11 12:15:08 +0000 |
commit | 6b701ec6f097faf253b2f0b556e96e76d135b060 (patch) | |
tree | a0d9381a6d28c8c397174c3b757364bebf79621f | |
parent | 33998917c69ae99a8b8cde80329e0413574f081c (diff) |
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 <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r-- | src/libs/utils/environment.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index c3b0f13f7c..e8e8938739 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; } } |