blob: 2b2792a6a059062aa2402048a55babd1b386aa4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# A workaround for accessing to NDK_DIR. This works since Env Vars are always accessible
# while cache variables are not
if (NDK_DIR)
set(ENV{_NDK_DIR} "${NDK_DIR}")
else (NDK_DIR)
set(NDK_DIR "$ENV{_NDK_DIR}")
endif (NDK_DIR)
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.
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
# Use the toolchain file that NDK provides
include(${NDK_DIR}/build/cmake/android.toolchain.cmake)
set(TARGET_OS "android")
set(TARGET_ARCH "aarch64")
|