aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZingo Andersen <zingo.andersen@arm.com>2021-12-14 14:02:46 +0100
committerZingo Andersen <zingo.andersen@arm.com>2021-12-20 13:03:54 +0000
commitbc2e217d90064820e272a5d178c35657a659a864 (patch)
tree9af1cf9025a81881d86430cd667aca052dedf9b1
parent446707fbc95ffedc7b2e463679dfcef1e827f649 (diff)
downloadarmnn-bc2e217d90064820e272a5d178c35657a659a864.tar.gz
Make it possible to add libs and includepath from armnn backends for tests
Signed-off-by: Zingo Andersen <zingo.andersen@arm.com> Change-Id: I95e6a5819ba60e41235f9d64c0ad7ce8706a3123
-rw-r--r--Android.mk34
1 files changed, 31 insertions, 3 deletions
diff --git a/Android.mk b/Android.mk
index fc5900be0c..df8cc8a670 100644
--- a/Android.mk
+++ b/Android.mk
@@ -318,6 +318,7 @@ LOCAL_PROPRIETARY_MODULE := true
# placeholder to hold all backend unit test source files
ARMNN_BACKEND_TEST_SOURCES :=
+ARMNN_BACKEND_TEST_INCLUDES :=
#
# iterate through the backend common and specific include paths, include them into the current
@@ -334,6 +335,29 @@ $(foreach mkPath,$(ARMNN_BACKEND_MAKEFILE_DIRS), \
$(eval ARMNN_BACKEND_TEST_SOURCES := $(ARMNN_BACKEND_TEST_SOURCES) \
$(patsubst %,$(mkPath)/%,$(BACKEND_TEST_SOURCES))))
+$(foreach mkPath,$(ARMNN_BACKEND_MAKEFILE_DIRS),\
+ $(eval include $(LOCAL_PATH)/$(mkPath)/backend.mk)\
+ $(eval ARMNN_BACKEND_TEST_INCLUDES += $(BACKEND_TEST_INCLUDES)))
+
+# Placeholder to hold all backend link files.
+ARMNN_BACKEND_TEST_STATIC_LIBRARIES :=
+ARMNN_BACKEND_TEST_SHARED_LIBRARIES :=
+
+# Iterate through the Arm NN backends and specific include paths, include them into the
+# current makefile and append the linkfiles held by
+# the optional BACKEND_STATIC_LIBRARIES and optional BACKEND_SHARED_LIBRARIES variable
+# (included from the given makefile) to
+# the ARMNN_BACKEND_STATIC_LIBRARIES and ARMNN_BACKEND_SHARED_LIBRARIES lists
+
+$(foreach mkPath,$(ARMNN_BACKEND_MAKEFILE_DIRS),\
+ $(eval include $(LOCAL_PATH)/$(mkPath)/backend.mk)\
+ $(eval ARMNN_BACKEND_TEST_STATIC_LIBRARIES += $(BACKEND_TEST_STATIC_LIBRARIES)))
+
+$(foreach mkPath,$(ARMNN_BACKEND_MAKEFILE_DIRS),\
+ $(eval include $(LOCAL_PATH)/$(mkPath)/backend.mk)\
+ $(eval ARMNN_BACKEND_TEST_SHARED_LIBRARIES += $(BACKEND_TEST_SHARED_LIBRARIES)))
+
+
# Mark source files as dependent on Android.mk
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
@@ -352,7 +376,9 @@ LOCAL_C_INCLUDES := \
$(ARMNN_PROFILING_HEADER_PATH) \
$(ARMNN_BACKENDS_HEADER_PATH) \
$(ARMNN_SERIALIZER_HEADER_PATH) \
- $(ARMNN_DESERIALIZER_HEADER_PATH)
+ $(ARMNN_DESERIALIZER_HEADER_PATH) \
+ $(ARMNN_BACKEND_INCLUDES)
+
LOCAL_CFLAGS := \
-std=$(CPP_VERSION) \
@@ -457,7 +483,8 @@ endif
LOCAL_STATIC_LIBRARIES := \
libneuralnetworks_common \
libflatbuffers-framework \
- arm_compute_library
+ arm_compute_library \
+ $(ARMNN_BACKEND_TEST_STATIC_LIBRARIES)
LOCAL_WHOLE_STATIC_LIBRARIES := libarmnn
@@ -470,7 +497,8 @@ LOCAL_SHARED_LIBRARIES := \
libutils \
android.hardware.neuralnetworks@1.0 \
android.hidl.allocator@1.0 \
- android.hidl.memory@1.0
+ android.hidl.memory@1.0 \
+ $(ARMNN_BACKEND_TEST_SHARED_LIBRARIES)
ifeq ($(ARMNN_INCLUDE_LIBOPENCL),1)
LOCAL_SHARED_LIBRARIES += \