blob: 50f4036c5adeac522a77a3873f0175085f940a2e [file] [log] [blame]
Christopher Ferris70ca5e52014-02-04 22:09:16 -08001#######################################################
2## Shared definitions for all target test compilations.
3#######################################################
4
5LOCAL_CFLAGS += -DGTEST_OS_LINUX_ANDROID -DGTEST_HAS_STD_STRING
6
7LOCAL_C_INCLUDES += external/gtest/include
Dan Albertb05f2ca2014-09-12 14:46:57 -07008
9my_test_libcxx := false
10ifndef LOCAL_SDK_VERSION
11ifeq (,$(TARGET_BUILD_APPS))
Dan Albert683c3922014-09-26 15:45:33 -070012ifneq ($(filter $(strip $(LOCAL_CXX_STL)),libc++ libc++_static),)
Dan Albertb05f2ca2014-09-12 14:46:57 -070013my_test_libcxx := true
14endif
15endif
16endif
17
18ifeq ($(my_test_libcxx),true)
Dan Albert9b0c6ff2014-05-14 14:16:47 -070019LOCAL_STATIC_LIBRARIES += libgtest_libc++ libgtest_main_libc++
Dan Albert965bfef2014-05-14 14:16:47 -070020else
Christopher Ferris70ca5e52014-02-04 22:09:16 -080021LOCAL_STATIC_LIBRARIES += libgtest libgtest_main
22
23ifndef LOCAL_SDK_VERSION
24LOCAL_C_INCLUDES += bionic \
25 bionic/libstdc++/include \
26 external/stlport/stlport
Dan Albert4bbc6c72014-09-19 14:25:57 -070027LOCAL_SHARED_LIBRARIES += libstlport libstdc++
Christopher Ferris70ca5e52014-02-04 22:09:16 -080028endif
Dan Albert965bfef2014-05-14 14:16:47 -070029endif
Christopher Ferris70ca5e52014-02-04 22:09:16 -080030
Colin Cross8c141e72014-03-24 18:39:18 -070031ifdef LOCAL_MODULE_PATH
32$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH when building test $(LOCAL_MODULE))
Christopher Ferris70ca5e52014-02-04 22:09:16 -080033endif
Colin Cross8c141e72014-03-24 18:39:18 -070034
35ifdef LOCAL_MODULE_PATH_32
36$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_32 when building test $(LOCAL_MODULE))
37endif
38
39ifdef LOCAL_MODULE_PATH_64
40$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_64 when building test $(LOCAL_MODULE))
41endif
42
Ying Wang4b1c95d2014-07-08 17:07:36 -070043LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
44LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)