-Wdocumentation won't seek -isystem. LIBXML2's headers in a certain distro might be incompatible to -Wdocumentation.
FIXME: Could autoconf detect clang or availability of -isystem?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185927
91177308-0d34-0410-b5e6-
96231b3b80d8
include $(CLANG_LEVEL)/Makefile
LIBS += $(LIBXML2_LIBS)
+
+# Headers in $(LIBXML2_INC) should not be checked with clang's -Wdocumentation.
+# Use -isystem instead of -I then.
+# FIXME: Could autoconf detect clang or availability of -isystem?
+ifneq ($(findstring -Wdocumentation,$(OPTIMIZE_OPTION)),)
+CPPFLAGS += $(subst -I,-isystem ,$(LIBXML2_INC))
+else
CPPFLAGS += $(LIBXML2_INC)
+endif