summaryrefslogtreecommitdiffstats
path: root/core/binary.mk
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-03-18 00:15:28 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-18 00:15:28 +0000
commit96000a611a76e4b07f009066696a90cbffebda17 (patch)
treef56cb668789de26798a2290ed2f3c31da8528781 /core/binary.mk
parent2044c092021531908b0743b4c4308c3729b66536 (diff)
parent314b5c98cbd68d11e7484b5e35a1bea466cde66b (diff)
downloadbuild-96000a611a76e4b07f009066696a90cbffebda17.zip
build-96000a611a76e4b07f009066696a90cbffebda17.tar.gz
build-96000a611a76e4b07f009066696a90cbffebda17.tar.bz2
am 314b5c98: am 66a4ef8f: am d14f3cc7: am 5384c187: Merge "Add LOCAL_NDK_STL_VARIANT:=c++_static and c++_shared"
* commit '314b5c98cbd68d11e7484b5e35a1bea466cde66b': Add LOCAL_NDK_STL_VARIANT:=c++_static and c++_shared
Diffstat (limited to 'core/binary.mk')
-rw-r--r--core/binary.mk23
1 files changed, 20 insertions, 3 deletions
diff --git a/core/binary.mk b/core/binary.mk
index 931e422..8f7453c 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -22,10 +22,12 @@ ifdef LOCAL_SDK_VERSION
my_ndk_stl_shared_lib_fullpath :=
my_ndk_stl_shared_lib :=
my_ndk_stl_static_lib :=
+ my_ndk_stl_cppflags :=
+ LOCAL_NDK_STL_VARIANT := $(strip $(LOCAL_NDK_STL_VARIANT))
ifeq (,$(LOCAL_NDK_STL_VARIANT))
LOCAL_NDK_STL_VARIANT := system
endif
- ifneq (1,$(words $(filter system stlport_static stlport_shared gnustl_static, $(LOCAL_NDK_STL_VARIANT))))
+ ifneq (1,$(words $(filter system stlport_static stlport_shared c++_static c++_shared gnustl_static, $(LOCAL_NDK_STL_VARIANT))))
$(error $(LOCAL_PATH): Unknown LOCAL_NDK_STL_VARIANT $(LOCAL_NDK_STL_VARIANT))
endif
ifeq (system,$(LOCAL_NDK_STL_VARIANT))
@@ -40,6 +42,18 @@ ifdef LOCAL_SDK_VERSION
my_ndk_stl_shared_lib_fullpath := $(my_ndk_source_root)/cxx-stl/stlport/libs/$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)CPU_ABI)/libstlport_shared.so
my_ndk_stl_shared_lib := -lstlport_shared
endif
+ else # LOCAL_NDK_STL_VARIANT is not stlport_* either
+ ifneq (,$(filter c++_%, $(LOCAL_NDK_STL_VARIANT)))
+ my_ndk_stl_include_path := $(my_ndk_source_root)/cxx-stl/llvm-libc++/libcxx/include \
+ $(my_ndk_source_root)/cxx-stl/llvm-libc++/gabi++/include \
+ $(my_ndk_source_root)/android/support/include
+ ifeq (c++_static,$(LOCAL_NDK_STL_VARIANT))
+ my_ndk_stl_static_lib := $(my_ndk_source_root)/cxx-stl/llvm-libc++/libs/$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)CPU_ABI)/libc++_static.a
+ else
+ my_ndk_stl_shared_lib_fullpath := $(my_ndk_source_root)/cxx-stl/llvm-libc++/libs/$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)CPU_ABI)/libc++_shared.so
+ my_ndk_stl_shared_lib := -lc++_shared
+ endif
+ my_ndk_stl_cppflags := -std=c++11
else
# LOCAL_NDK_STL_VARIANT is gnustl_static
my_ndk_stl_include_path := $(my_ndk_source_root)/cxx-stl/gnu-libstdc++/libs/$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)CPU_ABI)/include \
@@ -47,6 +61,7 @@ ifdef LOCAL_SDK_VERSION
my_ndk_stl_static_lib := $(my_ndk_source_root)/cxx-stl/gnu-libstdc++/libs/$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)CPU_ABI)/libgnustl_static.a
endif
endif
+ endif
endif
##################################################
@@ -181,19 +196,21 @@ ifndef LOCAL_IS_HOST_MODULE
ifdef LOCAL_SDK_VERSION
my_target_project_includes :=
my_target_c_includes := $(my_ndk_stl_include_path) $(my_ndk_version_root)/usr/include
+my_target_global_cppflags := $(my_ndk_stl_cppflags)
else
my_target_project_includes := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_PROJECT_INCLUDES)
my_target_c_includes := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_C_INCLUDES)
+my_target_global_cppflags :=
endif # LOCAL_SDK_VERSION
ifeq ($(LOCAL_CLANG),true)
my_target_global_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_TARGET_GLOBAL_CFLAGS)
-my_target_global_cppflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_TARGET_GLOBAL_CPPFLAGS)
+my_target_global_cppflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_TARGET_GLOBAL_CPPFLAGS)
my_target_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)CLANG_TARGET_GLOBAL_LDFLAGS)
my_target_c_includes += $(CLANG_CONFIG_EXTRA_TARGET_C_INCLUDES)
else
my_target_global_cflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CFLAGS)
-my_target_global_cppflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CPPFLAGS)
+my_target_global_cppflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CPPFLAGS)
my_target_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LDFLAGS)
endif # LOCAL_CLANG