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_SRCS)
11
12# Add a symbol to determine when building for a test.
13TARGET_CFLAGS += -DGTEST
14
15# Ignore sign comparison warnings triggered by EXPECT/ASSERT macros in tests
16# (typically, unsigned value vs. implicitly signed literal)
17TARGET_CFLAGS += -Wno-sign-compare
18
19ifneq ($(filter $(TARGET_NAME)% all, $(MAKECMDGOALS)),)
20
21ifeq ($(ANDROID_BUILD_TOP),)
22$(error "You should supply an ANDROID_BUILD_TOP environment variable \
23         containing a path to the Android source tree. This is typically \
24         provided by initializing the Android build environment.")
25endif
26export GOOGLETEST_PREFIX=$(ANDROID_BUILD_TOP)/external/googletest
27include $(CHRE_PREFIX)/build/arch/x86.mk
28
29TARGET_CFLAGS += $(GOOGLETEST_CFLAGS)
30TARGET_CFLAGS += $(GOOGLE_X86_GOOGLETEST_CFLAGS)
31
32# Instruct the build to link a final executable.
33TARGET_BUILD_BIN = true
34
35# Link in libraries for the final executable.
36TARGET_BIN_LDFLAGS += -lrt
37TARGET_BIN_LDFLAGS += -lpthread
38
39include $(CHRE_PREFIX)/build/build_template.mk
40endif
41