platform_build/core/target_test_internal.mk
Colin Cross 3a0a8918b2 Link libgtest_main before libgtest
libgtest_main uses symbols from libgtest.  If libgtest_main is linked
after libgtest, and the test .o files don't reference libgtest (which is
unlikely), then the libgtest .o files will be ignored and libgtest_main
won't be able to find its symbols from libgtest.

Change-Id: Ica3bc679bd9d14e9a3065be927f085cf52faab64
2015-09-25 16:11:31 -07:00

28 lines
963 B
Makefile

#######################################################
## Shared definitions for all target test compilations.
#######################################################
LOCAL_CFLAGS += -DGTEST_OS_LINUX_ANDROID -DGTEST_HAS_STD_STRING
LOCAL_C_INCLUDES += external/gtest/include
ifndef LOCAL_SDK_VERSION
LOCAL_STATIC_LIBRARIES += libgtest_main libgtest
else
LOCAL_STATIC_LIBRARIES += libgtest_main_ndk libgtest_ndk
endif
ifdef LOCAL_MODULE_PATH
$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH when building test $(LOCAL_MODULE))
endif
ifdef LOCAL_MODULE_PATH_32
$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_32 when building test $(LOCAL_MODULE))
endif
ifdef LOCAL_MODULE_PATH_64
$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_64 when building test $(LOCAL_MODULE))
endif
LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)