From 9725cf1531742a47c04513439d0564cab2f344d6 Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Fri, 22 Jan 2021 00:15:18 +0800 Subject: [PATCH] [android] add library `libcutils` for compiling ot-cli and ot-ncp (#6104) When compiling ot-cli and ot-ncp, the Android.mk will compile the function `property_get` in `src/core/api/instance_api.cpp`. The function `property_get` is provided by the library `libcutils`. GitHub Action uses Android NDK to compile Android.mk, Android NDK only allows adding the shared library `libcutils` for the library `ot-core`. However, Android requires to add the shared library `libutils` for the binary `ot-cli` and `ot-ncp`. Therefore, this PR uses the macro `ANDROID_NDK` to distinguish these two cases. --- Android.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Android.mk b/Android.mk index d11dde674..30369f494 100644 --- a/Android.mk +++ b/Android.mk @@ -429,6 +429,10 @@ include $(CLEAR_VARS) LOCAL_MODULE := ot-cli LOCAL_MODULE_TAGS := eng +ifneq ($(ANDROID_NDK),1) +LOCAL_SHARED_LIBRARIES := libcutils +endif + LOCAL_C_INCLUDES := \ $(OPENTHREAD_PROJECT_INCLUDES) \ $(LOCAL_PATH)/include \ @@ -509,6 +513,10 @@ include $(CLEAR_VARS) LOCAL_MODULE := ot-ncp LOCAL_MODULE_TAGS := eng +ifneq ($(ANDROID_NDK),1) +LOCAL_SHARED_LIBRARIES := libcutils +endif + LOCAL_C_INCLUDES := \ $(OPENTHREAD_PROJECT_INCLUDES) \ $(LOCAL_PATH)/include \