blob: 038cf65435773445e991db29d0268b93566794ad [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 \
24 libclangTooling
Stephen Hinesf71d14a2013-02-27 13:34:21 -080025
Tong Shene5599602014-09-19 12:02:00 -070026# 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)
Josh Gao4e42e0f2016-04-13 17:03:52 -070033LOCAL_EXPORT_C_INCLUDE_DIRS += \
34 $(LOCAL_PATH)/include \
35 external/llvm/include \
36 external/llvm/device/include
Stephen Hinesf71d14a2013-02-27 13:34:21 -080037
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070038LOCAL_SHARED_LIBRARIES := libLLVM
39
40LOCAL_LDLIBS_windows := -limagehlp -lpsapi
41
42LOCAL_SHARED_LIBRARIES_darwin := libc++
43LOCAL_SHARED_LIBRARIES_linux := libc++
44LOCAL_LDLIBS_darwin := -ldl -lpthread
45LOCAL_LDLIBS_linux := -ldl -lpthread
Stephen Hinesf71d14a2013-02-27 13:34:21 -080046
47include $(CLANG_HOST_BUILD_MK)
Tim Murray9e8bf2c2013-03-06 10:12:22 -080048
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070049# Don't build the library unless forced to. We don't
50# have prebuilts for windows.
51ifneq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
52LOCAL_MODULE_HOST_OS := windows
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070053else
54LOCAL_MODULE_HOST_OS := darwin linux windows
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070055endif
56
Dan Willemsenf1f1bc32015-09-02 13:30:48 -070057include $(BUILD_HOST_SHARED_LIBRARY)
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070058
59# Don't build the library unless forced to.
60ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
Tong Shene5599602014-09-19 12:02:00 -070061# device
62include $(CLEAR_VARS)
63
64LOCAL_MODULE:= libclang
65LOCAL_MODULE_TAGS := optional
66LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries)
67
68LOCAL_SHARED_LIBRARIES := libLLVM libc++
69LOCAL_LDLIBS := -ldl
70
71include $(CLANG_DEVICE_BUILD_MK)
72include $(BUILD_SHARED_LIBRARY)
Dan Willemsen2d2dc9f2015-08-18 17:06:48 -070073endif # don't build unless forced to
Tong Shene5599602014-09-19 12:02:00 -070074
Stephen Hinesce5d5dc2013-09-06 16:53:40 -070075endif # don't build in unbundled branches