+ ifdef LOCAL_SDK_VERSION
+ # The NDK has historically used LOCAL_NDK_STL_VARIANT to specify the
+ # STL. An Android.mk that specifies both LOCAL_CXX_STL and
+ # LOCAL_SDK_VERSION will incorrectly try (and most likely fail) to use
+ # the platform STL in an NDK binary. Emit an error to direct the user
+ # toward the correct option.
+ #
+ # Note that we could also accept LOCAL_CXX_STL as an alias for
+ # LOCAL_NDK_STL_VARIANT (and in fact soong does use the same name), but
+ # the two options use different names for the STLs.
+ $(error $(LOCAL_PATH): $(LOCAL_MODULE): Must use LOCAL_NDK_STL_VARIANT rather than LOCAL_CXX_STL for NDK binaries)
+ endif
+ ifdef LOCAL_IS_HOST_MODULE
+ ifeq ($($(my_prefix)OS),windows)
+ ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),)
+ # libc++ is not supported on mingw.
+ my_cxx_stl := libstdc++
+ endif
+ endif
+ endif