[PATCH] Fix clang Makefile build with libxml2 enabled and CPPFLAGS is passed in

Keno Fischer kfischer at college.harvard.edu
Wed Aug 13 17:17:35 PDT 2014


When building clang, we pass in CPPFLAGS via the command line, which (I believe) makes this not work. CPP.Flags works nicely to get around this.

http://reviews.llvm.org/D4891

Files:
  tools/c-index-test/Makefile

Index: tools/c-index-test/Makefile
===================================================================
--- tools/c-index-test/Makefile
+++ tools/c-index-test/Makefile
@@ -34,15 +34,16 @@
 	   clangAnalysis.a clangEdit.a clangAST.a clangLex.a \
 	   clangBasic.a
 
-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))
+CPP.Flags += $(subst -I,-isystem ,$(LIBXML2_INC))
 else
-CPPFLAGS += $(LIBXML2_INC)
+CPP.Flags += $(LIBXML2_INC)
 endif
+
+include $(CLANG_LEVEL)/Makefile
+
+LIBS = $(LIBXML2_LIBS)
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4891.12472.patch
Type: text/x-patch
Size: 803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140814/edde2553/attachment.bin>


More information about the cfe-commits mailing list