Skip to content

Commit 5db8bb1

Browse files
michalpiszczekTrevor Morris
authored andcommitted
Add option to specify flatbuffers location (apache#5425)
1 parent f187575 commit 5db8bb1

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cmake/config.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ set(USE_TFLITE OFF)
154154
# /path/to/tensorflow: tensorflow root path when use tflite library
155155
set(USE_TENSORFLOW_PATH none)
156156

157+
# Required for full builds with TFLite. Not needed for runtime with TFLite.
158+
# /path/to/flatbuffers: flatbuffers root path when using tflite library
159+
set(USE_FLATBUFFERS_PATH none)
160+
157161
# Possible values:
158162
# - OFF: disable tflite support for edgetpu
159163
# - /path/to/edgetpu: use specific path to edgetpu library

cmake/modules/contrib/TFLite.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
if(NOT USE_TFLITE STREQUAL "OFF")
1919
message(STATUS "Build with contrib.tflite")
20-
if (USE_TENSORFLOW_PATH STREQUAL "none")
20+
if (USE_TENSORFLOW_PATH STREQUAL "none")
2121
set(USE_TENSORFLOW_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tensorflow)
2222
endif()
2323

@@ -40,5 +40,8 @@ if(NOT USE_TFLITE STREQUAL "OFF")
4040
find_library(TFLITE_CONTRIB_LIB libtensorflow-lite.a ${USE_TFLITE})
4141

4242
list(APPEND TVM_RUNTIME_LINKER_LIBS ${TFLITE_CONTRIB_LIB})
43-
list(APPEND TVM_RUNTIME_LINKER_LIBS rt dl flatbuffers)
43+
44+
if (NOT USE_FLATBUFFERS_PATH STREQUAL "none")
45+
include_directories(${USE_FLATBUFFERS_PATH}/include)
46+
endif()
4447
endif()

0 commit comments

Comments
 (0)