1 ########################################################### 2 ########################################################### 3 ### 4 ### GTest libraries. 5 ### 6 ### GoogleTest is used to build the emulator's Android-specific 7 ### unit tests. The sources are located under 8 ### $ANDROID/extern/gtest but because we need to build both 9 ### 32-bit and 64-bit host libraries, don't reuse the 10 ### Android.mk there, define a module here instead. 11 12 EMULATOR_GTEST_SOURCES_DIR ?= $(LOCAL_PATH)/../gtest 13 EMULATOR_GTEST_SOURCES_DIR := $(EMULATOR_GTEST_SOURCES_DIR) 14 ifeq (,$(strip $(wildcard $(EMULATOR_GTEST_SOURCES_DIR)))) 15 $(error Cannot find GoogleTest sources directory: $(EMULATOR_GTEST_SOURCES_DIR)) 16 endif 17 18 EMULATOR_GTEST_INCLUDES := $(EMULATOR_GTEST_SOURCES_DIR)/include 19 EMULATOR_GTEST_SOURCES := src/gtest-all.cc src/gtest_main.cc 20 EMULATOR_GTEST_LDLIBS := -lstdc++ 21 22 old_LOCAL_PATH := $(LOCAL_PATH) 23 24 LOCAL_PATH := $(EMULATOR_GTEST_SOURCES_DIR) 25 26 $(call start-emulator-library, emulator-libgtest) 27 LOCAL_C_INCLUDES += $(EMULATOR_GTEST_INCLUDES) 28 LOCAL_CPP_EXTENSION := .cc 29 LOCAL_CFLAGS += -O0 30 LOCAL_SRC_FILES := $(EMULATOR_GTEST_SOURCES) 31 $(call end-emulator-library) 32 33 $(call start-emulator64-library, emulator64-libgtest) 34 LOCAL_C_INCLUDES += $(EMULATOR_GTEST_INCLUDES) 35 LOCAL_CPP_EXTENSION := .cc 36 LOCAL_CFLAGS += -O0 37 LOCAL_SRC_FILES := $(EMULATOR_GTEST_SOURCES) 38 $(call end-emulator-library) 39 40 LOCAL_PATH := $(old_LOCAL_PATH) 41 42