diff options
author | David 'Digit' Turner <digit@google.com> | 2014-02-27 19:45:42 +0100 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2014-03-06 00:32:11 +0100 |
commit | 32851ad05bd779ed04d5992ec241d54238c12fbc (patch) | |
tree | 4e5d810cfb9605cde4a158adbe129dbe739d9543 /emulator | |
parent | 7693d297d269b2d294ce4ce1c854991668eeb8eb (diff) | |
download | sdk-32851ad05bd779ed04d5992ec241d54238c12fbc.zip sdk-32851ad05bd779ed04d5992ec241d54238c12fbc.tar.gz sdk-32851ad05bd779ed04d5992ec241d54238c12fbc.tar.bz2 |
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
Diffstat (limited to 'emulator')
-rw-r--r-- | emulator/opengl/Android.mk | 10 | ||||
-rw-r--r-- | emulator/opengl/googletest.mk | 30 | ||||
-rw-r--r-- | emulator/opengl/shared/emugl/common/Android.mk | 9 |
3 files changed, 45 insertions, 4 deletions
diff --git a/emulator/opengl/Android.mk b/emulator/opengl/Android.mk index da29214..0f5b856 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 0000000..9719138 --- /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 d0b9d4e..5c444fd 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) |