ProjectExplorer/MSVC: Ignore warning options when looking for predefined macros

...since they should not have any effect on the macros. This potentially
also reduces the cache.

Change-Id: If50cfa50ce0fb29dff291bf2c329532fc6284644
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-10-08 14:10:20 +02:00
parent feae30d7ad
commit 4cd527f496

View File

@@ -146,10 +146,15 @@ LanguageVersion static languageVersionForMsvc(const Core::Id &language, const Ma
}
}
bool static hasFlagEffectOnMacros(const QString &arg)
bool static hasFlagEffectOnMacros(const QString &flag)
{
if (arg.startsWith("-I"))
return false;
if (flag.startsWith("-") || flag.startsWith("/")) {
const QString f = flag.mid(1);
if (f.startsWith("I"))
return false; // Skip include paths
if (f.startsWith("w", Qt::CaseInsensitive))
return false; // Skip warning options
}
return true;
}