1# Don't build the library in unbundled branches.
2ifeq (,$(TARGET_BUILD_APPS))
3
4LOCAL_PATH:= $(call my-dir)
5
6clang_whole_static_libraries := \
7	libclangAnalysis \
8	libclangAST \
9	libclangASTMatchers \
10	libclangBasic \
11	libclangCodeGen \
12	libclangDriver \
13	libclangEdit \
14	libclangFormat \
15	libclangFrontend \
16	libclangIndex \
17	libclangLex \
18	libclangLibclang \
19	libclangParse \
20	libclangRewrite \
21	libclangRewriteFrontend \
22	libclangSema \
23	libclangSerialization \
24	libclangTooling
25
26# host
27include $(CLEAR_VARS)
28
29LOCAL_IS_HOST_MODULE := true
30LOCAL_MODULE:= libclang
31LOCAL_MODULE_TAGS := optional
32LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries)
33
34LOCAL_SHARED_LIBRARIES := libLLVM
35
36LOCAL_LDLIBS_windows := -limagehlp -lpsapi
37
38LOCAL_SHARED_LIBRARIES_darwin := libc++
39LOCAL_SHARED_LIBRARIES_linux := libc++
40LOCAL_LDLIBS_darwin := -ldl -lpthread
41LOCAL_LDLIBS_linux := -ldl -lpthread
42
43include $(CLANG_HOST_BUILD_MK)
44
45# Don't build the library unless forced to. We don't
46# have prebuilts for windows.
47ifneq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
48LOCAL_MODULE_HOST_OS := windows
49else
50LOCAL_MODULE_HOST_OS := darwin linux windows
51endif
52
53include $(BUILD_HOST_SHARED_LIBRARY)
54
55# Don't build the library unless forced to.
56ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
57# device
58include $(CLEAR_VARS)
59
60LOCAL_MODULE:= libclang
61LOCAL_MODULE_TAGS := optional
62LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries)
63
64LOCAL_SHARED_LIBRARIES := libLLVM libc++
65LOCAL_LDLIBS := -ldl
66
67include $(CLANG_DEVICE_BUILD_MK)
68include $(BUILD_SHARED_LIBRARY)
69endif # don't build unless forced to
70
71endif # don't build in unbundled branches
72