xref: /aosp_15_r20/external/llvm/llvm-host-build.mk (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard WorkerLOCAL_CFLAGS +=	\
2*9880d681SAndroid Build Coastguard Worker	-D_GNU_SOURCE	\
3*9880d681SAndroid Build Coastguard Worker	-D__STDC_LIMIT_MACROS	\
4*9880d681SAndroid Build Coastguard Worker	-fomit-frame-pointer	\
5*9880d681SAndroid Build Coastguard Worker	-Wall	\
6*9880d681SAndroid Build Coastguard Worker	-W	\
7*9880d681SAndroid Build Coastguard Worker	-Wno-sign-compare \
8*9880d681SAndroid Build Coastguard Worker	-Wno-unused-parameter	\
9*9880d681SAndroid Build Coastguard Worker	-Wno-maybe-uninitialized \
10*9880d681SAndroid Build Coastguard Worker	-Wno-missing-field-initializers \
11*9880d681SAndroid Build Coastguard Worker	-Wwrite-strings	\
12*9880d681SAndroid Build Coastguard Worker	-Werror \
13*9880d681SAndroid Build Coastguard Worker	-Dsprintf=sprintf \
14*9880d681SAndroid Build Coastguard Worker	$(LOCAL_CFLAGS)
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker# Disable certain warnings for use with mingw.
17*9880d681SAndroid Build Coastguard Worker# We also must undefine WIN32_LEAN_AND_MEAN, since it is being passed globally
18*9880d681SAndroid Build Coastguard Worker# on the command line, and LLVM defines this internally itself.
19*9880d681SAndroid Build Coastguard WorkerLOCAL_CFLAGS_windows += -Wno-array-bounds \
20*9880d681SAndroid Build Coastguard Worker			-Wno-comment \
21*9880d681SAndroid Build Coastguard Worker			-UWIN32_LEAN_AND_MEAN
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Worker# Enable debug build only on Linux and Darwin
24*9880d681SAndroid Build Coastguard Workerifeq ($(FORCE_BUILD_LLVM_DEBUG),true)
25*9880d681SAndroid Build Coastguard WorkerLOCAL_CFLAGS_linux += -O0 -g
26*9880d681SAndroid Build Coastguard WorkerLOCAL_CFLAGS_darwin += -O0 -g
27*9880d681SAndroid Build Coastguard Workerendif
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workerifeq ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true)
30*9880d681SAndroid Build Coastguard WorkerLOCAL_CFLAGS :=	\
31*9880d681SAndroid Build Coastguard Worker	$(LOCAL_CFLAGS) \
32*9880d681SAndroid Build Coastguard Worker	-D_DEBUG	\
33*9880d681SAndroid Build Coastguard Worker	-UNDEBUG
34*9880d681SAndroid Build Coastguard Workerendif
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard WorkerLOCAL_CFLAGS += -fno-exceptions
37*9880d681SAndroid Build Coastguard WorkerLOCAL_CPPFLAGS += -fno-rtti
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard WorkerLOCAL_CPPFLAGS :=	\
40*9880d681SAndroid Build Coastguard Worker	$(LOCAL_CPPFLAGS)	\
41*9880d681SAndroid Build Coastguard Worker	-Wno-sign-promo         \
42*9880d681SAndroid Build Coastguard Worker	-std=c++11
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard WorkerLOCAL_CPPFLAGS_linux := \
45*9880d681SAndroid Build Coastguard Worker	-Woverloaded-virtual
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard WorkerLOCAL_CPPFLAGS_darwin += \
48*9880d681SAndroid Build Coastguard Worker	-Wno-deprecated-declarations \
49*9880d681SAndroid Build Coastguard Worker	-Woverloaded-virtual
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Worker# Make sure bionic is first so we can include system headers.
52*9880d681SAndroid Build Coastguard WorkerLOCAL_C_INCLUDES :=	\
53*9880d681SAndroid Build Coastguard Worker	$(LLVM_ROOT_PATH)	\
54*9880d681SAndroid Build Coastguard Worker	$(LLVM_ROOT_PATH)/include	\
55*9880d681SAndroid Build Coastguard Worker	$(LLVM_ROOT_PATH)/host/include	\
56*9880d681SAndroid Build Coastguard Worker	$(LOCAL_C_INCLUDES)
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard WorkerLOCAL_LDLIBS_linux += -lgcc_s
59*9880d681SAndroid Build Coastguard WorkerLOCAL_LDLIBS_windows += -luuid
60*9880d681SAndroid Build Coastguard Worker
61*9880d681SAndroid Build Coastguard WorkerLOCAL_IS_HOST_MODULE := true
62*9880d681SAndroid Build Coastguard Worker
63*9880d681SAndroid Build Coastguard Workerifeq (libLLVM, $(filter libLLVM,$(LOCAL_SHARED_LIBRARIES)$(LOCAL_SHARED_LIBRARIES_$(HOST_OS))))
64*9880d681SAndroid Build Coastguard Worker# Skip building a 32-bit shared object if they are using libLLVM.
65*9880d681SAndroid Build Coastguard WorkerLOCAL_MULTILIB := first
66*9880d681SAndroid Build Coastguard Workerendif
67