summaryrefslogtreecommitdiff
path: root/runtimes/libs/tflite/CMakeLists.txt
blob: 8b85e7183ba3e24761585f168ee1c201a5a98259 (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
26
nnfw_find_package(TensorFlowLite REQUIRED)

file(GLOB_RECURSE SOURCES "src/*.cpp")
file(GLOB_RECURSE TESTS "src/*.test.cpp")
list(REMOVE_ITEM SOURCES ${TESTS})

# NOTE For now NNFW supports two TFLITE versions - v1.12 for Ubuntu and v1.9 for Tizen.
#      So TFLITE version should mandatorily be specified to distinguish the version.
if(NOT TFLITE_MAJOR_VER OR NOT TFLITE_MINOR_VER)
  message(FATAL_ERROR "TFLITE_MAJOR_VER and TFLITE_MINOR_VER should be defined")
endif(NOT TFLITE_MAJOR_VER OR NOT TFLITE_MINOR_VER)

add_library(nnfw_lib_tflite STATIC ${SOURCES})
set_target_properties(nnfw_lib_tflite PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(nnfw_lib_tflite PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(nnfw_lib_tflite PUBLIC tensorflow-lite)
target_link_libraries(nnfw_lib_tflite PUBLIC nnfw_lib_misc nnfw_lib_rua_shim)
target_link_libraries(nnfw_lib_tflite PRIVATE ${LIB_PTHREAD} dl)
target_link_libraries(nnfw_lib_tflite PRIVATE nnfw_common)
target_link_libraries(nnfw_lib_tflite PRIVATE nnfw_coverage)

target_compile_definitions(nnfw_lib_tflite PUBLIC TFLITE_MAJOR_VER=${TFLITE_MAJOR_VER}
                                                  TFLITE_MINOR_VER=${TFLITE_MINOR_VER})

add_executable(nnfw_lib_tflite_test_TensorView src/TensorView.test.cpp)
target_link_libraries(nnfw_lib_tflite_test_TensorView nnfw_lib_tflite)