From 32851ad05bd779ed04d5992ec241d54238c12fbc Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 27 Feb 2014 19:45:42 +0100 Subject: emulator/opengl: Build 64-bit unit tests. This is done by building a special version of GoogleTest specially for the GPU emulation libraries. Change-Id: Ie27c75d9a85836f392375e110a5152031af586bc --- emulator/opengl/Android.mk | 10 +++++++++ emulator/opengl/googletest.mk | 30 ++++++++++++++++++++++++++ emulator/opengl/shared/emugl/common/Android.mk | 9 ++++---- 3 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 emulator/opengl/googletest.mk (limited to 'emulator/opengl') diff --git a/emulator/opengl/Android.mk b/emulator/opengl/Android.mk index da292142d..0f5b856b1 100644 --- a/emulator/opengl/Android.mk +++ b/emulator/opengl/Android.mk @@ -30,6 +30,12 @@ endif # EMUGL_COMMON_CFLAGS := -DWITH_GLES2 +# Define EMUGL_BUILD_DEBUG=1 in your environment to build a +# debug version of the EmuGL host binaries. +ifneq (,$(strip $(EMUGL_BUILD_DEBUG))) +EMUGL_COMMON_CFLAGS += -O0 -g -DEMUGL_DEBUG=1 +endif + # Uncomment the following line if you want to enable debug traces # in the GLES emulation libraries. # EMUGL_COMMON_CFLAGS += -DEMUGL_DEBUG=1 @@ -59,6 +65,10 @@ include $(EMUGL_PATH)/common.mk # source files (see all emugl-gen-decoder/encoder in common.mk) # include $(EMUGL_PATH)/host/tools/emugen/Android.mk + +# Required by our units test. +include $(EMUGL_PATH)/googletest.mk + include $(EMUGL_PATH)/shared/emugl/common/Android.mk include $(EMUGL_PATH)/shared/OpenglOsUtils/Android.mk include $(EMUGL_PATH)/shared/OpenglCodecCommon/Android.mk diff --git a/emulator/opengl/googletest.mk b/emulator/opengl/googletest.mk new file mode 100644 index 000000000..971913846 --- /dev/null +++ b/emulator/opengl/googletest.mk @@ -0,0 +1,30 @@ +# This contains common definitions used to define a host module +# to link GoogleTest with the EmuGL test programs. +# +# This is used instead of including external/gtest/Android.mk to +# be able to build both the 32-bit and 64-bit binaries while +# building a 32-bit only SDK (sdk-eng, sdk_x86-eng, sdk_mips-eng). + +LOCAL_PATH := external/gtest + +$(call emugl-begin-host-static-library,libemugl_gtest) +LOCAL_SRC_FILES := \ + src/gtest-all.cc \ + src/gtest_main.cc +LOCAL_CFLAGS += -O0 +LOCAL_CPP_EXTENSION := .cc +$(call emugl-export,C_INCLUDES,$(LOCAL_PATH)/include) +$(call emugl-export,LDLIBS,-lpthread) +$(call emugl-end-module) + +$(call emugl-begin-host-static-library,lib64emugl_gtest) +LOCAL_SRC_FILES := \ + src/gtest-all.cc \ + src/gtest_main.cc +LOCAL_CFLAGS += -O0 +LOCAL_C_INCLUDES += $(LOCAL_PATH)/include +LOCAL_CPP_EXTENSION := .cc +$(call emugl-export,C_INCLUDES,$(LOCAL_PATH)/include) +$(call emugl-export,CFLAGS,-m64) +$(call emugl-export,LDLIBS,-lpthread -m64) +$(call emugl-end-module) diff --git a/emulator/opengl/shared/emugl/common/Android.mk b/emulator/opengl/shared/emugl/common/Android.mk index d0b9d4e7b..5c444fd1e 100644 --- a/emulator/opengl/shared/emugl/common/Android.mk +++ b/emulator/opengl/shared/emugl/common/Android.mk @@ -27,9 +27,10 @@ host_commonSources := \ $(call emugl-begin-host-executable,emugl_common_host_unittests) LOCAL_SRC_FILES := $(host_commonSources) -LOCAL_C_INCLUDES += external/gtest/include -LOCAL_LDFLAGS += -lpthread -$(call emugl-export,STATIC_LIBRARIES, libemugl_common libgtest_host libgtest_main_host) +$(call emugl-import,libemugl_common libemugl_gtest) $(call emugl-end-module) -# TODO(digit): 64-bit version, once we have 64-bit gtest. +$(call emugl-begin-host-executable,emugl64_common_host_unittests) +LOCAL_SRC_FILES := $(host_commonSources) +$(call emugl-import,lib64emugl_common lib64emugl_gtest) +$(call emugl-end-module) -- cgit v1.2.3