From 401a84071bff63b6ccfa239d01ad3e54621aff2e Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Wed, 7 Aug 2019 14:37:46 -0700 Subject: [PATCH] -D__ANDROID_NDK__ for SDK builds. The NDK is built like this. Having it for app builds within the Android build system allows us to distinguish platform code from app code. This is specifically to distinguish AIDL interfaces using libbinder_ndk. 'myBinder-ndk_platform' libs will use additional functionality that 'myBinder-ndk' libs won't use (in the future, these may be separate variants with the same name, see b/121157555). Bug: 136027762 Test: using this to distinuish code in NDK vs platform code Change-Id: I27471b9184e8d67fc51c8eace317f92b3f0f3539 --- core/binary.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/binary.mk b/core/binary.mk index 4709e8e3fc..e91616444e 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -119,6 +119,8 @@ ifneq ($(LOCAL_SDK_VERSION),) $(error $(LOCAL_PATH): LOCAL_SDK_VERSION cannot be used in host module) endif + my_cflags += -D__ANDROID_NDK__ + # Make sure we've built the NDK. my_additional_dependencies += $(SOONG_OUT_DIR)/ndk_base.timestamp