blob: b6fea102ca4a7439850b3d79c62e2482d1a0c508 [file] [log] [blame]
# Don't build the library in unbundled branches.
ifeq (,$(TARGET_BUILD_APPS))
LOCAL_PATH:= $(call my-dir)
clang_whole_static_libraries := \
libclangAnalysis \
libclangAST \
libclangASTMatchers \
libclangBasic \
libclangCodeGen \
libclangDriver \
libclangEdit \
libclangFormat \
libclangFrontend \
libclangIndex \
libclangLex \
libclangLibclang \
libclangParse \
libclangRewrite \
libclangRewriteFrontend \
libclangSema \
libclangSerialization \
libclangTooling \
libclangToolingCore
# host
include $(CLEAR_VARS)
LOCAL_IS_HOST_MODULE := true
LOCAL_MODULE:= libclang
LOCAL_MODULE_TAGS := optional
LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries)
LOCAL_EXPORT_C_INCLUDE_DIRS += \
$(LOCAL_PATH)/include \
external/llvm/include \
external/llvm/device/include
LOCAL_SHARED_LIBRARIES := libLLVM
LOCAL_LDLIBS_windows := -limagehlp -lpsapi -lversion
LOCAL_SHARED_LIBRARIES_darwin := libc++
LOCAL_SHARED_LIBRARIES_linux := libc++
LOCAL_LDLIBS_darwin := -ldl -lpthread
LOCAL_LDLIBS_linux := -ldl -lpthread
include $(CLANG_HOST_BUILD_MK)
# Don't build the library unless forced to. We don't
# have prebuilts for windows.
ifneq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
LOCAL_MODULE_HOST_OS := windows
else
LOCAL_MODULE_HOST_OS := darwin linux windows
endif
include $(BUILD_HOST_SHARED_LIBRARY)
# Don't build the library unless forced to.
ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
# device
include $(CLEAR_VARS)
LOCAL_MODULE:= libclang
LOCAL_MODULE_TAGS := optional
LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries)
LOCAL_SHARED_LIBRARIES := libLLVM libc++
LOCAL_LDLIBS := -ldl
include $(CLANG_DEVICE_BUILD_MK)
include $(BUILD_SHARED_LIBRARY)
endif # don't build unless forced to
endif # don't build in unbundled branches