• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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)
11TARGET_PLATFORM_ID = 0x476f6f676c000001
12
13TARGET_CFLAGS += $(SIM_CFLAGS)
14TARGET_VARIANT_SRCS += $(SIM_SRCS)
15
16# Add a symbol to determine when building for a test.
17TARGET_CFLAGS += -DGTEST
18
19# Ignore sign comparison warnings triggered by EXPECT/ASSERT macros in tests
20# (typically, unsigned value vs. implicitly signed literal)
21TARGET_CFLAGS += -Wno-sign-compare
22
23# Ignore missing field initializers as googletest will not compile with this
24# warning enabled.
25TARGET_CFLAGS += -Wno-missing-field-initializers
26
27TARGET_SO_LATE_LIBS = $(GOOGLE_X86_GOOGLETEST_LATE_LIBS)
28
29ifneq ($(filter $(TARGET_NAME)% all, $(MAKECMDGOALS)),)
30
31ifeq ($(ANDROID_BUILD_TOP),)
32$(error "You should supply an ANDROID_BUILD_TOP environment variable \
33         containing a path to the Android source tree. This is typically \
34         provided by initializing the Android build environment.")
35endif
36export GOOGLETEST_PREFIX=$(ANDROID_BUILD_TOP)/external/googletest
37include $(CHRE_PREFIX)/build/arch/x86.mk
38
39TARGET_CFLAGS += $(GOOGLETEST_CFLAGS)
40TARGET_CFLAGS += $(GOOGLE_X86_GOOGLETEST_CFLAGS)
41
42# Instruct the build to link a final executable.
43TARGET_BUILD_BIN = true
44
45# Link in libraries for the final executable.
46TARGET_BIN_LDFLAGS += -lrt -ldl
47TARGET_BIN_LDFLAGS += -lpthread
48TARGET_BIN_LDFLAGS += $(shell pkg-config --libs sndfile)
49
50include $(CHRE_PREFIX)/build/build_template.mk
51endif
52