diff options
author | Dan Albert <danalbert@google.com> | 2015-12-09 14:46:13 -0800 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-12-09 15:59:17 -0800 |
commit | 0e2e71dc2e307976d3b631d782c1c018bf0b4811 (patch) | |
tree | 4816ef2f84f8b76c7dcfbc9bd83407b469fad78f | |
parent | c7d5e54dfe71766dc60adcf06e6ec1a2b12cdda9 (diff) | |
download | build-0e2e71dc2e307976d3b631d782c1c018bf0b4811.tar.gz |
Add support for LOCAL_NDK_STL_VARIANT := none.
Sometimes we don't want any STL.
Change-Id: I08b4389b7882702c0e483a1456f7775fe4da1c75
-rw-r--r-- | core/binary.mk | 12 | ||||
-rw-r--r-- | core/cxx_stl_setup.mk | 3 |
2 files changed, 8 insertions, 7 deletions
diff --git a/core/binary.mk b/core/binary.mk index 60a95aebb1..0c70dd547a 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -106,15 +106,16 @@ ifdef LOCAL_SDK_VERSION ifeq (,$(LOCAL_NDK_STL_VARIANT)) LOCAL_NDK_STL_VARIANT := system endif - ifneq (1,$(words $(filter system stlport_static stlport_shared c++_static c++_shared gnustl_static, $(LOCAL_NDK_STL_VARIANT)))) + ifneq (1,$(words $(filter none 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)) my_ndk_stl_include_path := $(my_ndk_source_root)/cxx-stl/system/include - # for "system" variant, the shared library exists in the system library and -lstdc++ is added by default. + my_system_shared_libraries += libstdc++ else # LOCAL_NDK_STL_VARIANT is not system ifneq (,$(filter stlport_%, $(LOCAL_NDK_STL_VARIANT))) my_ndk_stl_include_path := $(my_ndk_source_root)/cxx-stl/stlport/stlport + my_system_shared_libraries += libstdc++ ifeq (stlport_static,$(LOCAL_NDK_STL_VARIANT)) my_ndk_stl_static_lib := $(my_ndk_source_root)/cxx-stl/stlport/libs/$(my_cpu_variant)/libstlport_static.a else @@ -133,11 +134,14 @@ ifdef LOCAL_SDK_VERSION my_ndk_stl_shared_lib := -lc++_shared endif my_ndk_stl_cppflags := -std=c++11 - else - # LOCAL_NDK_STL_VARIANT is gnustl_static + else # LOCAL_NDK_STL_VARIANT is not c++_* either + ifneq (,$(filter gnustl_%, $(LOCAL_NDK_STL_VARIANT))) my_ndk_stl_include_path := $(my_ndk_source_root)/cxx-stl/gnu-libstdc++/$($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_NDK_GCC_VERSION)/libs/$(my_cpu_variant)/include \ $(my_ndk_source_root)/cxx-stl/gnu-libstdc++/$($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_NDK_GCC_VERSION)/include my_ndk_stl_static_lib := $(my_ndk_source_root)/cxx-stl/gnu-libstdc++/$($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_NDK_GCC_VERSION)/libs/$(my_cpu_variant)/libgnustl_static.a + else # LOCAL_NDK_STL_VARIANT must be none + # Do nothing. + endif endif endif endif diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk index be8a711560..37be1f7cc8 100644 --- a/core/cxx_stl_setup.mk +++ b/core/cxx_stl_setup.mk @@ -104,9 +104,6 @@ ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),) endif else ifeq ($(my_cxx_stl),ndk) # Using an NDK STL. Handled in binary.mk. - ifndef LOCAL_IS_HOST_MODULE - my_system_shared_libraries += libstdc++ - endif else ifeq ($(my_cxx_stl),libstdc++) # Using bionic's basic libstdc++. Not actually an STL. Only around until the # tree is in good enough shape to not need it. |