blob: b6fea102ca4a7439850b3d79c62e2482d1a0c508 [file] [log] [blame]
Tim Murray9e8bf2c2013-03-06 10:12:22 -08001# Don't build the library in unbundled branches.
2ifeq (,$(TARGET_BUILD_APPS))
3
Stephen Hinesf71d14a2013-02-27 13:34:21 -08004LOCAL_PATH:= $(call my-dir)
5
Tong Shene5599602014-09-19 12:02:00 -07006clang_whole_static_libraries := \
Stephen Hinesf71d14a2013-02-27 13:34:21 -08007 libclangAnalysis \
Stephen Hinesf71d14a2013-02-27 13:34:21 -08008 libclangAST \
Tao Baodb719ce2015-02-19 14:45:44 -08009 libclangASTMatchers \
Stephen Hinesf71d14a2013-02-27 13:34:21 -080010 libclangBasic \
Tao Baodb719ce2015-02-19 14:45:44 -080011 libclangCodeGen \
12 libclangDriver \
13 libclangEdit \
14 libclangFormat \
15 libclangFrontend \
16 libclangIndex \
17 libclangLex \
18 libclangLibclang \
19 libclangParse \
Stephen Hines176edba2014-12-01 14:53:08 -080020 libclangRewrite \
Todd Fiala3313f882013-10-22 16:11:47 -070021 libclangRewriteFrontend \
Tao Baodb719ce2015-02-19 14:45:44 -080022 libclangSema \
23 libclangSerialization \
Pirama Arumuga Nainar4967a712016-09-19 22:19:55 -070024 libclangTooling \
25 libclangToolingCore
Stephen Hinesf71d14a2013-02-27 13:34:21 -080026
Tong Shene5599602014-09-19 12:02:00 -070027# host
28include $(CLEAR_VARS)
29
30LOCAL_IS_HOST_MODULE := true
31LOCAL_MODULE:= libclang
32LOCAL_MODULE_TAGS := optional
33LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries)
Josh Gao4e42e0f2016-04-13 17:03:52 -070034LOCAL_EXPORT_C_INCLUDE_DIRS += \
35 $(LOCAL_PATH)/include \
36 external/llvm/include \
37 external/llvm/device/include
Stephen Hinesf71d14a2013-02-27 13:34:21 -080038
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070039LOCAL_SHARED_LIBRARIES := libLLVM
40
Pirama Arumuga Nainar4967a712016-09-19 22:19:55 -070041LOCAL_LDLIBS_windows := -limagehlp -lpsapi -lversion
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070042
43LOCAL_SHARED_LIBRARIES_darwin := libc++
44LOCAL_SHARED_LIBRARIES_linux := libc++
45LOCAL_LDLIBS_darwin := -ldl -lpthread
46LOCAL_LDLIBS_linux := -ldl -lpthread
Stephen Hinesf71d14a2013-02-27 13:34:21 -080047
48include $(CLANG_HOST_BUILD_MK)
Tim Murray9e8bf2c2013-03-06 10:12:22 -080049
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070050# Don't build the library unless forced to. We don't
51# have prebuilts for windows.
52ifneq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
53LOCAL_MODULE_HOST_OS := windows
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070054else
55LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070056endif
57
Dan Willemsenf1f1bc32015-09-02 13:30:48 -070058include $(BUILD_HOST_SHARED_LIBRARY)
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070059
60# Don't build the library unless forced to.
61ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
Tong Shene5599602014-09-19 12:02:00 -070062# device
63include $(CLEAR_VARS)
64
65LOCAL_MODULE:= libclang
66LOCAL_MODULE_TAGS := optional
67LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries)
68
69LOCAL_SHARED_LIBRARIES := libLLVM libc++
70LOCAL_LDLIBS := -ldl
71
72include $(CLANG_DEVICE_BUILD_MK)
73include $(BUILD_SHARED_LIBRARY)
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070074endif # don't build unless forced to
Tong Shene5599602014-09-19 12:02:00 -070075
Stephen Hinesce5d5dc2013-09-06 16:53:40 -070076endif # don't build in unbundled branches