CppTools: Make CompilerOptionsBuilder hide intrinsics.

Change-Id: I8b677fc82672ca5fd36bae18480467ef95201dcc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2015-01-30 18:30:08 +01:00
parent 773b41ff61
commit b6a0dbeec7

View File

@@ -510,9 +510,17 @@ QStringList CompilerOptionsBuilder::createDefineOptions(const QByteArray &define
bool toolchainDefines,
const QString &toolchainType)
{
QByteArray extendedDefines = defines;
QStringList result;
foreach (QByteArray def, defines.split('\n')) {
// In gcc headers, lots of built-ins are referenced that clang does not understand.
// Therefore, prevent the inclusion of the header that references them. Of course, this
// will break if code actually requires stuff from there, but that should be the less common
// case.
if (toolchainType == QLatin1String("mingw") || toolchainType == QLatin1String("gcc"))
extendedDefines += "#define _X86INTRIN_H_INCLUDED\n";
foreach (QByteArray def, extendedDefines.split('\n')) {
if (def.isEmpty())
continue;