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); + } } } }