Update Makefile.template for Android (#7919)
author이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Tue, 8 Oct 2019 05:06:39 +0000 (14:06 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 8 Oct 2019 05:06:39 +0000 (14:06 +0900)
Pass and set additional CMake variables for Android build.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
Makefile.template
infra/nnfw/cmake/buildtool/cross/toolchain_arm64-android.cmake

index a35cde9..a120398 100644 (file)
@@ -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)
index c77c2a2..97c249c 100644 (file)
@@ -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.