From 170735ca2ec33afcf07638b8c6fedfa24fe40886 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=ED=95=9C=EC=A2=85/On-Device=20Lab=28SR=29/Enginee?= =?utf8?q?r/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 8 Oct 2019 14:06:39 +0900 Subject: [PATCH] Update Makefile.template for Android (#7919) Pass and set additional CMake variables for Android build. Signed-off-by: Hanjoung Lee --- Makefile.template | 4 ++++ infra/nnfw/cmake/buildtool/cross/toolchain_arm64-android.cmake | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Makefile.template b/Makefile.template index a35cde9..a120398 100644 --- a/Makefile.template +++ b/Makefile.template @@ -57,6 +57,10 @@ ifneq ($(EXTERNAL_VOLUME),) OPTIONS+= -DNNAS_EXTERNALS_DIR=$(EXTERNAL_VOLUME) endif +ifeq ($(TARGET_OS),android) + OPTIONS+= -DNDK_DIR=$(NDK_DIR) +endif + ifeq ($(PARALLEL_BUILD),1) # Get number of processors (linux only for now) ifeq ($(HOST_OS),linux) diff --git a/infra/nnfw/cmake/buildtool/cross/toolchain_arm64-android.cmake b/infra/nnfw/cmake/buildtool/cross/toolchain_arm64-android.cmake index c77c2a2..97c249c 100644 --- a/infra/nnfw/cmake/buildtool/cross/toolchain_arm64-android.cmake +++ b/infra/nnfw/cmake/buildtool/cross/toolchain_arm64-android.cmake @@ -10,6 +10,9 @@ if(NOT DEFINED NDK_DIR) message(FATAL_ERROR "NDK_DIR should be specified via cmake argument") endif(NOT DEFINED NDK_DIR) +set(ANDROID_ABI arm64-v8a) +set(ANDROID_PLATFORM android-27) + # Find package in the host. `nnfw_find_package` won't work without this set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER) # Find library in the host. Necessary for `add_library` searching in `out/lib` dir. -- 2.7.4