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