summaryrefslogtreecommitdiffstats
path: root/core/target_test_internal.mk
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-09-12 14:46:57 -0700
committerDan Albert <danalbert@google.com>2014-09-18 16:38:20 -0700
commitb05f2ca150dddf2a2a5ef0ae683181e3b979ef2d (patch)
tree1c782b300999fa1de6ac0f6d947840b54f68237d /core/target_test_internal.mk
parent88cfa0324724c7e90bfed3aaa61c27ca0926860b (diff)
downloadbuild-b05f2ca150dddf2a2a5ef0ae683181e3b979ef2d.zip
build-b05f2ca150dddf2a2a5ef0ae683181e3b979ef2d.tar.gz
build-b05f2ca150dddf2a2a5ef0ae683181e3b979ef2d.tar.bz2
Move selection of C++ STL into the build system.
Preparing for migration from stlport to libc++. STL selection is done with LOCAL_CXX_STL (valid values are default, none, libc++, libc++_static, stlport, stlport_static, bionic). The selection of the STL is as follows: if LOCAL_CXX_STL == 'default' ifdef LOCAL_SDK_VERSION Use whatever STL the other NDK options have selected. else Use bionic's libstdc++ for target, GNU libstdc++ for host. This is compatible with the existing build options. endif else if LOCAL_CXX_STL == 'stlport' Use stlport. else if LOCAL_CXX_STL == 'libc++' Use libc++. else if LOCAL_CXX_STL == '' Don't use any STL. endif endif Bug: 15193147 Change-Id: If712ba0ae7908d8147a69e29da5c453a183d6540
Diffstat (limited to 'core/target_test_internal.mk')
-rw-r--r--core/target_test_internal.mk12
1 files changed, 11 insertions, 1 deletions
diff --git a/core/target_test_internal.mk b/core/target_test_internal.mk
index 95d4159..6b147b1 100644
--- a/core/target_test_internal.mk
+++ b/core/target_test_internal.mk
@@ -5,7 +5,17 @@
LOCAL_CFLAGS += -DGTEST_OS_LINUX_ANDROID -DGTEST_HAS_STD_STRING
LOCAL_C_INCLUDES += external/gtest/include
-ifneq ($(filter libc++,$(LOCAL_SHARED_LIBRARIES)),)
+
+my_test_libcxx := false
+ifndef LOCAL_SDK_VERSION
+ifeq (,$(TARGET_BUILD_APPS))
+ifeq ($(strip $(LOCAL_CXX_STL)),libc++)
+my_test_libcxx := true
+endif
+endif
+endif
+
+ifeq ($(my_test_libcxx),true)
LOCAL_STATIC_LIBRARIES += libgtest_libc++ libgtest_main_libc++
else
LOCAL_STATIC_LIBRARIES += libgtest libgtest_main