From db4b145536a837c63f810967d73fc7946df3edb1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 16 May 2017 14:37:44 +0200 Subject: [PATCH] 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 --- .../qmakeprojectmanager/qmakeproject.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index c7ff2a2765f..c241189d9e1 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -1281,12 +1281,18 @@ void QmakeProject::testToolChain(ToolChain *tc, const Utils::FileName &path) con if (!env.isSameExecutable(path.toString(), expected.toString())) { const QPair pair = qMakePair(expected, path); if (!m_toolChainWarnings.contains(pair)) { - 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."). - arg(path.toUserOutput()).arg(expected.toUserOutput()), - Utils::FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); - m_toolChainWarnings.insert(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."). + arg(path.toUserOutput()).arg(expected.toUserOutput()), + Utils::FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + m_toolChainWarnings.insert(pair); + } } } }