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>
This commit is contained in:
Orgad Shaneh
2018-07-10 23:14:08 +03:00
committed by Orgad Shaneh
parent 33998917c6
commit 6b701ec6f0

View File

@@ -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;
}
}