Add stl include path if LOCAL_NDK_VERSION is set
Since NDKr5 the stl headers reside in a separate directory.
Change-Id: I98f37b593560a1a2a55418f8ba413ca842ed37ef
diff --git a/core/binary.mk b/core/binary.mk
index dcac435..7a17ccd 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -28,6 +28,7 @@
ifndef LOCAL_SDK_VERSION
$(error $(LOCAL_PATH): LOCAL_NDK_VERSION must be defined with LOCAL_SDK_VERSION)
endif
+ my_ndk_source_root := $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r$(LOCAL_NDK_VERSION)/sources
my_ndk_version_root := $(HISTORICAL_NDK_VERSIONS_ROOT)/android-ndk-r$(LOCAL_NDK_VERSION)/platforms/android-$(LOCAL_SDK_VERSION)/arch-$(TARGET_ARCH)
ifeq ($(wildcard $(my_ndk_version_root)),)
$(error $(LOCAL_PATH): ndk version root does not exist: $(my_ndk_version_root))
@@ -59,6 +60,8 @@
ifdef LOCAL_NDK_VERSION
my_target_project_includes :=
my_target_c_inclues := $(my_ndk_version_root)/usr/include
+# Starting from NDK-r5 the c++ stl headers reside in a separate directory
+my_target_c_inclues += $(my_ndk_source_root)/cxx-stl/system/include
# TODO: more reliable way to remove platform stuff.
my_target_global_cflags := $(filter-out -include -I system/%, $(TARGET_GLOBAL_CFLAGS))
my_target_global_cppflags := $(filter-out -include -I system/%, $(TARGET_GLOBAL_CPPFLAGS))