aboutsummaryrefslogtreecommitdiff
path: root/build/variant/google_x86_googletest.mk
blob: 3e6313b81039201e7e38b0c9cdccf0acecd49e0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#
# CHRE GoogleTest Build Variant
#

include $(CHRE_PREFIX)/build/clean_build_template_args.mk

TARGET_NAME = google_x86_googletest
TARGET_CFLAGS = -DCHRE_MESSAGE_TO_HOST_MAX_SIZE=2048
TARGET_VARIANT_SRCS = $(GOOGLE_X86_GOOGLETEST_SRCS)
TARGET_VARIANT_SRCS += $(GOOGLETEST_SRCS)
TARGET_PLATFORM_ID = 0x476f6f676c000001

TARGET_CFLAGS += $(SIM_CFLAGS)
TARGET_VARIANT_SRCS += $(SIM_SRCS)

# Add a symbol to determine when building for a test.
TARGET_CFLAGS += -DGTEST

# Ignore sign comparison warnings triggered by EXPECT/ASSERT macros in tests
# (typically, unsigned value vs. implicitly signed literal)
TARGET_CFLAGS += -Wno-sign-compare

# Ignore missing field initializers as googletest will not compile with this
# warning enabled.
TARGET_CFLAGS += -Wno-missing-field-initializers

TARGET_SO_LATE_LIBS = $(GOOGLE_X86_GOOGLETEST_LATE_LIBS)

ifneq ($(filter $(TARGET_NAME)% all, $(MAKECMDGOALS)),)

ifeq ($(ANDROID_BUILD_TOP),)
$(error "You should supply an ANDROID_BUILD_TOP environment variable \
         containing a path to the Android source tree. This is typically \
         provided by initializing the Android build environment.")
endif
export GOOGLETEST_PREFIX=$(ANDROID_BUILD_TOP)/external/googletest
include $(CHRE_PREFIX)/build/arch/x86.mk

TARGET_CFLAGS += $(GOOGLETEST_CFLAGS)
TARGET_CFLAGS += $(GOOGLE_X86_GOOGLETEST_CFLAGS)

# Instruct the build to link a final executable.
TARGET_BUILD_BIN = true

# Link in libraries for the final executable.
TARGET_BIN_LDFLAGS += -lrt -ldl
TARGET_BIN_LDFLAGS += -lpthread
TARGET_BIN_LDFLAGS += $(shell pkg-config --libs sndfile)

include $(CHRE_PREFIX)/build/build_template.mk
endif