From 965bfefb6b5f7a89d10fa5c03d06591e99314c4d Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 14 May 2014 14:16:47 -0700 Subject: [PATCH] Use libc++ versions of gtest libs when needed Change-Id: I19aa58a83a9da680d441af5f3956a2fbdf18c4e4 --- core/host_test_internal.mk | 4 ++++ core/target_test_internal.mk | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/core/host_test_internal.mk b/core/host_test_internal.mk index 650b9c6f5..c2c318656 100644 --- a/core/host_test_internal.mk +++ b/core/host_test_internal.mk @@ -5,7 +5,11 @@ LOCAL_CFLAGS += -DGTEST_OS_LINUX -DGTEST_HAS_STD_STRING -O0 -g LOCAL_C_INCLUDES += external/gtest/include +ifneq ($(filter libc++,$(LOCAL_SHARED_LIBRARIES)),) +LOCAL_STATIC_LIBRARIES += libgtest_libcxx_host libgtest_main_libcxx_host +else LOCAL_STATIC_LIBRARIES += libgtest_host libgtest_main_host LOCAL_SHARED_LIBRARIES += +endif LOCAL_LDLIBS += -lpthread diff --git a/core/target_test_internal.mk b/core/target_test_internal.mk index 7b99678f9..60a7c9efa 100644 --- a/core/target_test_internal.mk +++ b/core/target_test_internal.mk @@ -5,6 +5,9 @@ LOCAL_CFLAGS += -DGTEST_OS_LINUX_ANDROID -DGTEST_HAS_STD_STRING LOCAL_C_INCLUDES += external/gtest/include +ifneq ($(filter libc++,$(LOCAL_SHARED_LIBRARIES)),) +LOCAL_STATIC_LIBRARIES += libgtest_libcxx libgtest_main_libcxx +else LOCAL_STATIC_LIBRARIES += libgtest libgtest_main ifndef LOCAL_SDK_VERSION @@ -14,6 +17,7 @@ LOCAL_C_INCLUDES += bionic \ LOCAL_SHARED_LIBRARIES += libstlport LOCAL_STATIC_LIBRARIES += libstdc++ endif +endif ifndef LOCAL_MODULE_PATH LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)