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