Commit f567565d authored by Christian Kandeler's avatar Christian Kandeler
Browse files

CppTools: Filter out "bad" symbols when collecting compiler defines.

Not all defines make sense for non-compilation purposes.

Change-Id: I7c5dd5aaa6de5c8916dfc10eb54ae49efa22959d
Reviewed-by: default avatarNikolai Kosjar <>
parent 2f855643
......@@ -532,6 +532,15 @@ QStringList CompilerOptionsBuilder::createDefineOptions(const QByteArray &define
// gcc 4.9 has:
// #define __has_include(STR) __has_include__(STR)
// #define __has_include_next(STR) __has_include_next__(STR)
// The right-hand sides are gcc built-ins that clang does not understand, and they'd
// override clang's own (non-macro, it seems) definitions of the symbols on the left-hand
// side.
if (toolchainType == QLatin1String("gcc") && def.contains("has_include"))
QByteArray str = def.mid(8);
int spaceIdx = str.indexOf(' ');
const QString option = QLatin1String(toolchainType == QLatin1String("msvc") ? "/D" : "-D");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment