blob: 574545191768f4e52a61828c0362ac9b41f77221 [file] [log] [blame]
Christopher Ferris70ca5e52014-02-04 22:09:16 -08001#######################################################
2## Shared definitions for all target test compilations.
3#######################################################
4
Dan Willemsen9416c202016-12-21 20:27:06 -08005ifeq ($(LOCAL_GTEST),true)
6 LOCAL_CFLAGS += -DGTEST_OS_LINUX_ANDROID -DGTEST_HAS_STD_STRING
Christopher Ferris70ca5e52014-02-04 22:09:16 -08007
Dan Willemsen9416c202016-12-21 20:27:06 -08008 ifndef LOCAL_SDK_VERSION
Dan Albertb05cf542016-03-22 17:19:03 -07009 LOCAL_STATIC_LIBRARIES += libgtest_main libgtest
Dan Willemsen9416c202016-12-21 20:27:06 -080010 else
Dan Albert19fbd1c2018-01-04 13:34:21 -080011 # TODO(danalbert): Remove the suffix from the module since we only need the
12 # one variant now.
13 my_ndk_gtest_suffix := _c++
Dan Albertb05cf542016-03-22 17:19:03 -070014 LOCAL_STATIC_LIBRARIES += \
15 libgtest_main_ndk$(my_ndk_gtest_suffix) \
16 libgtest_ndk$(my_ndk_gtest_suffix)
Dan Willemsen9416c202016-12-21 20:27:06 -080017 endif
Dan Albert965bfef2014-05-14 14:16:47 -070018endif
Christopher Ferris70ca5e52014-02-04 22:09:16 -080019
Colin Cross8c141e72014-03-24 18:39:18 -070020ifdef LOCAL_MODULE_PATH
21$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH when building test $(LOCAL_MODULE))
Christopher Ferris70ca5e52014-02-04 22:09:16 -080022endif
Colin Cross8c141e72014-03-24 18:39:18 -070023
24ifdef LOCAL_MODULE_PATH_32
25$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_32 when building test $(LOCAL_MODULE))
26endif
27
28ifdef LOCAL_MODULE_PATH_64
29$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_64 when building test $(LOCAL_MODULE))
30endif
31
Nelson Li1f8357f2019-03-14 01:04:05 +000032use_testcase_folder := false
Sasha Smundakda25b692019-03-25 13:26:03 -070033ifneq ($(LOCAL_MODULE),$(filter $(LOCAL_MODULE),$(DEFAULT_DATA_OUT_MODULES)))
34 use_testcase_folder := true
Nelson Li1f8357f2019-03-14 01:04:05 +000035endif
36
37ifneq ($(use_testcase_folder),true)
Dan Willemsen7fe992c2016-03-02 13:54:51 -080038ifndef LOCAL_MODULE_RELATIVE_PATH
39LOCAL_MODULE_RELATIVE_PATH := $(LOCAL_MODULE)
40endif
Nelson Li1f8357f2019-03-14 01:04:05 +000041endif
Mitch Phillips1a8405f2021-03-01 09:12:25 -080042
43# Implicitly run this test under MTE SYNC for aarch64 binaries. This is a no-op
44# on non-MTE hardware.
45ifneq (,$(filter arm64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)))
46 LOCAL_WHOLE_STATIC_LIBRARIES += note_memtag_heap_sync
47endif