Qmake: Suppress spurious warnings about compiler mismatch on Apple

Suppress spurious warnings about compiler mismatches on Apple all the time
at the cost of potentially supressing some real issues.

Task-number: QTCREATORBUG-17794
Change-Id: I7bef3b8065de676d625905f3bf9936c91094b04f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2017-05-16 14:37:44 +02:00
parent c7a84634fd
commit db4b145536

View File

@@ -1281,6 +1281,11 @@ void QmakeProject::testToolChain(ToolChain *tc, const Utils::FileName &path) con
if (!env.isSameExecutable(path.toString(), expected.toString())) {
const QPair<Utils::FileName, Utils::FileName> pair = qMakePair(expected, path);
if (!m_toolChainWarnings.contains(pair)) {
// Suppress warnings on Apple machines where compilers in /usr/bin point into Xcode.
// This will suppress some valid warnings, but avoids annoying Apple users with
// spurious warnings all the time!
if (!pair.first.toString().startsWith("/usr/bin/")
|| !pair.second.toString().contains("/Contents/Developer/Toolchains/")) {
TaskHub::addTask(Task(Task::Warning,
QCoreApplication::translate("QmakeProjectManager", "\"%1\" is used by qmake, but \"%2\" is configured in the kit.\n"
"Please update your kit or choose a mkspec for qmake that matches your target environment better.").
@@ -1289,6 +1294,7 @@ void QmakeProject::testToolChain(ToolChain *tc, const Utils::FileName &path) con
m_toolChainWarnings.insert(pair);
}
}
}
}
void QmakeProject::warnOnToolChainMismatch(const QmakeProFile *pro) const