From 08e3d8f0117d3c5419250bad1749bc3f03703d71 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Mon, 6 Nov 2017 16:00:25 +0100 Subject: 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 --- src/plugins/cpptools/compileroptionsbuilder.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp') diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index 8f1ed2c416..af9ce9bf2c 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -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 -- cgit v1.2.1