From 66c16cf50724901a34eec91afcc63f5d215bd7f5 Mon Sep 17 00:00:00 2001 From: Michal Piszczek Date: Thu, 23 Apr 2020 16:25:46 -0700 Subject: [PATCH] Add option to specify flatbuffers location (#5425) --- cmake/config.cmake | 4 ++++ cmake/modules/contrib/TFLite.cmake | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/config.cmake b/cmake/config.cmake index e5681af110a0..7e5734e952a9 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -154,6 +154,10 @@ set(USE_TFLITE OFF) # /path/to/tensorflow: tensorflow root path when use tflite library set(USE_TENSORFLOW_PATH none) +# Required for full builds with TFLite. Not needed for runtime with TFLite. +# /path/to/flatbuffers: flatbuffers root path when using tflite library +set(USE_FLATBUFFERS_PATH none) + # Possible values: # - OFF: disable tflite support for edgetpu # - /path/to/edgetpu: use specific path to edgetpu library diff --git a/cmake/modules/contrib/TFLite.cmake b/cmake/modules/contrib/TFLite.cmake index ec03c960dfa7..c16a76d4b37e 100644 --- a/cmake/modules/contrib/TFLite.cmake +++ b/cmake/modules/contrib/TFLite.cmake @@ -17,7 +17,7 @@ if(NOT USE_TFLITE STREQUAL "OFF") message(STATUS "Build with contrib.tflite") - if (USE_TENSORFLOW_PATH STREQUAL "none") + if (USE_TENSORFLOW_PATH STREQUAL "none") set(USE_TENSORFLOW_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tensorflow) endif() @@ -40,5 +40,8 @@ if(NOT USE_TFLITE STREQUAL "OFF") find_library(TFLITE_CONTRIB_LIB libtensorflow-lite.a ${USE_TFLITE}) list(APPEND TVM_RUNTIME_LINKER_LIBS ${TFLITE_CONTRIB_LIB}) - list(APPEND TVM_RUNTIME_LINKER_LIBS rt dl flatbuffers) + + if (NOT USE_FLATBUFFERS_PATH STREQUAL "none") + include_directories(${USE_FLATBUFFERS_PATH}/include) + endif() endif()