From 69558df6f149647888267caabf72de6b05fb6d53 Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Fri, 31 Aug 2018 16:18:19 +0100 Subject: Fix for building the NN Driver correctly without having to set ALLOW_MISSING_DEPENDENCIES to true on Android versions that don't provide all the HAL versions supported by the NN Driver Change-Id: I7c828649499ca1d7cb26feb93f559e9f1eae33c7 --- Android.mk | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'Android.mk') diff --git a/Android.mk b/Android.mk index c0dd1e6d..960a2f6e 100644 --- a/Android.mk +++ b/Android.mk @@ -40,11 +40,11 @@ ifeq ($(PLATFORM_VERSION),9) # regardless of the HAL version used for the build. LOCAL_CFLAGS+= \ -DARMNN_ANDROID_P -endif +endif # PLATFORM_VERSION == 9 ifeq ($(ARMNN_DRIVER_DEBUG),1) LOCAL_CFLAGS+= \ -UNDEBUG -endif +endif # ARMNN_DRIVER_DEBUG == 1 LOCAL_SRC_FILES := \ 1.0/ArmnnDriverImpl.cpp \ @@ -80,10 +80,13 @@ ifeq ($(PLATFORM_VERSION),9) # as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless. LOCAL_SHARED_LIBRARIES+= \ android.hardware.neuralnetworks@1.1 -endif +endif # PLATFORM_VERSION == 9 include $(BUILD_STATIC_LIBRARY) +ifeq ($(PLATFORM_VERSION),9) +# The following target is available starting from Android P + ####################### # libarmnn-driver@1.1 # ####################### @@ -112,7 +115,7 @@ LOCAL_CFLAGS := \ ifeq ($(ARMNN_DRIVER_DEBUG),1) LOCAL_CFLAGS+= \ -UNDEBUG -endif +endif # ARMNN_DRIVER_DEBUG == 1 LOCAL_SRC_FILES := \ 1.0/ArmnnDriverImpl.cpp \ @@ -148,6 +151,8 @@ LOCAL_SHARED_LIBRARIES := \ include $(BUILD_STATIC_LIBRARY) +endif # PLATFORM_VERSION == 9 + ##################################################### # android.hardware.neuralnetworks@1.0-service-armnn # ##################################################### @@ -172,7 +177,7 @@ LOCAL_CFLAGS := \ ifeq ($(ARMNN_DRIVER_DEBUG),1) LOCAL_CFLAGS += \ -UNDEBUG -endif +endif # ARMNN_DRIVER_DEBUG == 1 LOCAL_SRC_FILES := \ service.cpp @@ -206,10 +211,13 @@ ifeq ($(PLATFORM_VERSION),9) # as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless. LOCAL_SHARED_LIBRARIES+= \ android.hardware.neuralnetworks@1.1 -endif +endif # PLATFORM_VERSION == 9 include $(BUILD_EXECUTABLE) +ifeq ($(PLATFORM_VERSION),9) +# The following target is available starting from Android P + ##################################################### # android.hardware.neuralnetworks@1.1-service-armnn # ##################################################### @@ -235,7 +243,7 @@ LOCAL_CFLAGS := \ ifeq ($(ARMNN_DRIVER_DEBUG),1) LOCAL_CFLAGS += \ -UNDEBUG -endif +endif # ARMNN_DRIVER_DEBUG == 1 LOCAL_SRC_FILES := \ service.cpp @@ -268,6 +276,8 @@ LOCAL_SHARED_LIBRARIES := \ include $(BUILD_EXECUTABLE) +endif # PLATFORM_VERSION == 9 + ########################## # armnn module and tests # ########################## -- cgit v1.2.1