1#
2# CHRE GoogleTest Build Variant
3#
4
5include $(CHRE_PREFIX)/build/clean_build_template_args.mk
6
7TARGET_NAME = google_x86_googletest
8TARGET_CFLAGS = -DCHRE_MESSAGE_TO_HOST_MAX_SIZE=2048
9TARGET_VARIANT_SRCS = $(GOOGLE_X86_GOOGLETEST_SRCS)
10TARGET_VARIANT_SRCS += $(GOOGLETEST_COMMON_SRCS)
11
12ifeq ($(RUN_PAL_IMPL_TESTS), true)
13TARGET_VARIANT_SRCS += $(GOOGLETEST_PAL_IMPL_SRCS)
14else
15TARGET_VARIANT_SRCS += $(GOOGLETEST_SRCS)
16endif
17
18TARGET_PLATFORM_ID = 0x476f6f676c000001
19
20TARGET_CFLAGS += $(SIM_CFLAGS)
21TARGET_VARIANT_SRCS += $(SIM_SRCS)
22
23# Add a symbol to determine when building for a test.
24TARGET_CFLAGS += -DGTEST
25
26# Ignore sign comparison warnings triggered by EXPECT/ASSERT macros in tests
27# (typically, unsigned value vs. implicitly signed literal)
28TARGET_CFLAGS += -Wno-sign-compare
29
30# Ignore missing field initializers as googletest will not compile with this
31# warning enabled.
32TARGET_CFLAGS += -Wno-missing-field-initializers
33
34TARGET_SO_LATE_LIBS = $(GOOGLE_X86_GOOGLETEST_LATE_LIBS)
35
36ifneq ($(filter $(TARGET_NAME)% all, $(MAKECMDGOALS)),)
37
38ifeq ($(ANDROID_BUILD_TOP),)
39$(error "You should supply an ANDROID_BUILD_TOP environment variable \
40         containing a path to the Android source tree. This is typically \
41         provided by initializing the Android build environment.")
42endif
43export GOOGLETEST_PREFIX=$(ANDROID_BUILD_TOP)/external/googletest
44include $(CHRE_PREFIX)/build/arch/x86.mk
45
46TARGET_CFLAGS += $(GOOGLETEST_CFLAGS)
47TARGET_CFLAGS += $(GOOGLE_X86_GOOGLETEST_CFLAGS)
48
49# Instruct the build to link a final executable.
50TARGET_BUILD_BIN = true
51
52# Link in libraries for the final executable.
53TARGET_BIN_LDFLAGS += -lrt -ldl
54TARGET_BIN_LDFLAGS += -lpthread
55TARGET_BIN_LDFLAGS += $(shell pkg-config --libs sndfile)
56
57include $(CHRE_PREFIX)/build/build_template.mk
58endif
59