aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Martincigh <matteo.martincigh@arm.com>2019-10-16 16:24:43 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-10-17 11:09:57 +0100
commitffdae27de9d0e4606738f7e725612a24910f2142 (patch)
tree9e87feb9b0c46c99e7fa80e7916138b224f2b20a
parent75e677939a98298e50d65c4a7e99a03fb51d5e3c (diff)
downloadandroid-nn-driver-ffdae27de9d0e4606738f7e725612a24910f2142.tar.gz
Move version definition to its own file
* Move the ArmNN version to a separate ArmnnVersion.txt file * Updated makefiles accordingly !referencetests:206978 !armnn:2089 Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com> Change-Id: I02b838bc71611a866b3f96335e44a33b0167134f
-rw-r--r--Android.mk18
-rw-r--r--test/Android.mk10
2 files changed, 25 insertions, 3 deletions
diff --git a/Android.mk b/Android.mk
index 098e49ca..cbc093ca 100644
--- a/Android.mk
+++ b/Android.mk
@@ -37,6 +37,11 @@ ARMNN_UTILS_HEADER_PATH := $(LOCAL_PATH)/armnn/src/armnnUtils
OPENCL_HEADER_PATH := $(LOCAL_PATH)/clframework/include
NN_HEADER_PATH := $(LOCAL_PATH)/../../../frameworks/ml/nn/runtime/include
+# Get ArmNN's version from file
+get_version_number = $(shell sed -n 's/.*$1 *\([0-9*]\)/\1/p' $(LOCAL_PATH)/armnn/ArmnnVersion.txt)
+ARMNN_VERSION := 20$(call get_version_number,ARMNN_MAJOR_VERSION)$(call get_version_number,ARMNN_MINOR_VERSION)$(call get_version_number,ARMNN_PATCH_VERSION)
+$(info android-nn-driver ARMNN_VERSION: $(ARMNN_VERSION))
+
# Variables to control CL/NEON/reference backend support
# Set them to '0' to disable support for a specific backend
ARMNN_COMPUTE_CL_ENABLED := 1
@@ -82,7 +87,8 @@ LOCAL_CFLAGS := \
-std=$(CPP_VERSION) \
-fexceptions \
-Werror \
- -Wno-format-security
+ -Wno-format-security \
+ -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION)
ifeq ($(P_OR_LATER),1)
# Required to build with the changes made to the Android ML framework starting from Android P,
@@ -205,6 +211,7 @@ LOCAL_CFLAGS := \
-fexceptions \
-Werror \
-Wno-format-security \
+ -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION) \
-DARMNN_ANDROID_P \
-DARMNN_ANDROID_NN_V1_1
@@ -314,6 +321,7 @@ LOCAL_CFLAGS := \
-fexceptions \
-Werror \
-Wno-format-security \
+ -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION) \
-DARMNN_ANDROID_Q \
-DARMNN_ANDROID_NN_V1_2
@@ -421,7 +429,9 @@ LOCAL_C_INCLUDES := \
LOCAL_CFLAGS := \
-std=$(CPP_VERSION) \
- -fexceptions
+ -fexceptions \
+ -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION)
+
ifeq ($(ARMNN_DRIVER_DEBUG),1)
LOCAL_CFLAGS += \
-UNDEBUG
@@ -512,7 +522,9 @@ LOCAL_C_INCLUDES := \
LOCAL_CFLAGS := \
-std=$(CPP_VERSION) \
-fexceptions \
+ -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION) \
-DARMNN_ANDROID_NN_V1_1
+
ifeq ($(ARMNN_DRIVER_DEBUG),1)
LOCAL_CFLAGS += \
-UNDEBUG
@@ -595,8 +607,10 @@ LOCAL_C_INCLUDES := \
LOCAL_CFLAGS := \
-std=$(CPP_VERSION) \
-fexceptions \
+ -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION) \
-DARMNN_ANDROID_NN_V1_2 \
-DBOOST_NO_AUTO_PTR
+
ifeq ($(ARMNN_DRIVER_DEBUG),1)
LOCAL_CFLAGS += \
-UNDEBUG
diff --git a/test/Android.mk b/test/Android.mk
index 93bfa695..68e8c7db 100644
--- a/test/Android.mk
+++ b/test/Android.mk
@@ -12,6 +12,11 @@ NN_HEADER_PATH := $(LOCAL_PATH)/../../../../frameworks/ml/nn/runtime/include
ARMNN_HEADER_PATH := $(LOCAL_PATH)/../armnn/include
ARMNN_DRIVER_HEADER_PATH := $(LOCAL_PATH)/..
+# Get ArmNN's version from file
+get_version_number = $(shell sed -n 's/.*$1 *\([0-9*]\)/\1/p' $(LOCAL_PATH)/../armnn/ArmnnVersion.txt)
+ARMNN_VERSION := 20$(call get_version_number,ARMNN_MAJOR_VERSION)$(call get_version_number,ARMNN_MINOR_VERSION)$(call get_version_number,ARMNN_PATCH_VERSION)
+$(info android-nn-driver/test ARMNN_VERSION: $(ARMNN_VERSION))
+
##########################
# armnn-driver-tests@1.0 #
##########################
@@ -40,7 +45,8 @@ LOCAL_CFLAGS := \
-fexceptions \
-Werror \
-O0 \
- -UNDEBUG
+ -UNDEBUG \
+ -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION)
ifeq ($(P_OR_LATER),1)
# Required to build with the changes made to the Android ML framework starting from Android P,
@@ -148,6 +154,7 @@ LOCAL_CFLAGS := \
-Werror \
-O0 \
-UNDEBUG \
+ -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION) \
-DARMNN_ANDROID_P \
-DARMNN_ANDROID_NN_V1_1
@@ -245,6 +252,7 @@ LOCAL_CFLAGS := \
-Werror \
-O0 \
-UNDEBUG \
+ -DARMNN_VERSION_FROM_FILE=$(ARMNN_VERSION) \
-DARMNN_ANDROID_Q \
-DARMNN_ANDROID_NN_V1_2