From 3a0a8918b2980b42b40c47d010cc299edc81f261 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 25 Sep 2015 16:11:31 -0700 Subject: [PATCH] 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 --- core/host_test_internal.mk | 2 +- core/target_test_internal.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/host_test_internal.mk b/core/host_test_internal.mk index 06949ed3e0..7f6aff0cef 100644 --- a/core/host_test_internal.mk +++ b/core/host_test_internal.mk @@ -11,4 +11,4 @@ LOCAL_LDLIBS_darwin += -lpthread LOCAL_CFLAGS += -DGTEST_HAS_STD_STRING -O0 -g LOCAL_C_INCLUDES += external/gtest/include -LOCAL_STATIC_LIBRARIES += libgtest_host libgtest_main_host +LOCAL_STATIC_LIBRARIES += libgtest_main_host libgtest_host diff --git a/core/target_test_internal.mk b/core/target_test_internal.mk index f8a9f049fa..4715fe8d59 100644 --- a/core/target_test_internal.mk +++ b/core/target_test_internal.mk @@ -7,9 +7,9 @@ LOCAL_CFLAGS += -DGTEST_OS_LINUX_ANDROID -DGTEST_HAS_STD_STRING LOCAL_C_INCLUDES += external/gtest/include ifndef LOCAL_SDK_VERSION -LOCAL_STATIC_LIBRARIES += libgtest libgtest_main +LOCAL_STATIC_LIBRARIES += libgtest_main libgtest else -LOCAL_STATIC_LIBRARIES += libgtest_ndk libgtest_main_ndk +LOCAL_STATIC_LIBRARIES += libgtest_main_ndk libgtest_ndk endif ifdef LOCAL_MODULE_PATH