Skip to content

Commit

Permalink
Put both src and obj clang paths on plugin include path
Browse files Browse the repository at this point in the history
Supports building against Clang where the build dir != src dir.
  • Loading branch information
evmar committed Feb 8, 2012
1 parent f23c6c0 commit 8239c14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xref-tools/cxx-clang/Makefile
@@ -1,13 +1,15 @@
LLVM_LIBS := $(shell llvm-config --libdir) LLVM_LIBS := $(shell llvm-config --libdir)
CXXFLAGS := -Wall -Werror -g -I$(shell llvm-config --includedir) \ CXXFLAGS := $(shell llvm-config --cflags) -Wall \
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -fPIC -fno-exceptions -fno-rtti -fno-exceptions -fno-rtti \
-I$(shell llvm-config --src-root)/tools/clang/include \
-I$(shell llvm-config --obj-root)/tools/clang/include
LDFLAGS := -fPIC -g -Wl,-R -Wl,'$$ORIGIN' -L$(LLVM_LIBS) -shared LDFLAGS := -fPIC -g -Wl,-R -Wl,'$$ORIGIN' -L$(LLVM_LIBS) -shared


prebuild: libclang-index-plugin.so prebuild: libclang-index-plugin.so


can-use: can-use:
@if [ -z "$$(which llvm-config)" -o \ @if [ -z "$$(which llvm-config)" -o \
! -d $$(llvm-config --includedir)/clang ]; then \ ! -d $(shell llvm-config --src-root)/tools/clang/include ]; then \
echo "no"; \ echo "no"; \
else \ else \
echo "yes"; \ echo "yes"; \
Expand Down

0 comments on commit 8239c14

Please sign in to comment.