Clang: Android: fix clang code model errors

Add missing gcc include directories in Android toolchain.
This introduces the similar "magic" that we have in qmake
(*qtsource*/qtbase/mkspecs/common/android-base-head.conf)
but allows us to have those paths wherever we use android
toolchain.

Change-Id: I5740f1f2339fd30670567f24db2be2454f665f41
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ivan Donchevskii
2017-11-06 16:00:25 +01:00
parent 1601f53542
commit 08e3d8f011
5 changed files with 119 additions and 40 deletions

View File

@@ -451,16 +451,10 @@ bool CompilerOptionsBuilder::excludeDefineDirective(const ProjectExplorer::Macro
if (macro.key == "__cplusplus")
return true;
// 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 (isGccOrMinGwToolchain(m_projectPart.toolchainType)
&& macro.key.contains("has_include")) {
// Ignore for all compiler toolchains since LLVM has it's own implementation for
// __has_include(STR) and __has_include_next(STR)
if (macro.key.startsWith("__has_include"))
return true;
}
// If _FORTIFY_SOURCE is defined (typically in release mode), it will
// enable the inclusion of extra headers to help catching buffer overflows