1# This contains common definitions used to define a host module
2# to link GoogleTest with the EmuGL test programs.
3#
4# This is used instead of including external/gtest/Android.mk to
5# be able to build both the 32-bit and 64-bit binaries while
6# building a 32-bit only SDK (sdk-eng, sdk_x86-eng, sdk_mips-eng).
7
8
9ifeq (true,$(BUILD_STANDALONE_EMULATOR))
10LOCAL_PATH := $(EMULATOR_GTEST_SOURCES_DIR)
11else
12LOCAL_PATH := $(EMUGL_PATH)/../../../external/gtest
13endif
14
15common_SRC_FILES := \
16    src/gtest-all.cc \
17    src/gtest_main.cc
18
19common_CFLAGS := -O0
20
21ifneq (windows,$(HOST_OS))
22    common_LDLIBS += -lpthread
23endif
24
25$(call emugl-begin-host-static-library,libemugl_gtest)
26LOCAL_SRC_FILES := $(common_SRC_FILES)
27LOCAL_CFLAGS += $(common_CFLAGS)
28LOCAL_CPP_EXTENSION := .cc
29$(call emugl-export,C_INCLUDES,$(LOCAL_PATH)/include)
30$(call emugl-export,LDLIBS,$(common_LDLIBS))
31$(call emugl-end-module)
32
33ifdef EMUGL_BUILD_64BITS
34    $(call emugl-begin-host64-static-library,lib64emugl_gtest)
35    LOCAL_SRC_FILES := $(common_SRC_FILES)
36    LOCAL_CFLAGS += $(common_CFLAGS)
37    LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
38    LOCAL_CPP_EXTENSION := .cc
39    $(call emugl-export,C_INCLUDES,$(LOCAL_PATH)/include)
40    $(call emugl-export,CFLAGS,-m64)
41    $(call emugl-export,LDLIBS,$(common_LDLIBS) -m64)
42    $(call emugl-end-module)
43endif  # EMUGL_BUILD_64BITS
44