Introduce BUILD_TENSORFLOW_LITE option (#4658)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 11 Mar 2019 05:58:21 +0000 (14:58 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 11 Mar 2019 05:58:21 +0000 (14:58 +0900)
This commit introduces BUILD_TENSORFLOW_LITE option and removes one
occurences of OBS_BUILD in CMakeLists.txt via using this flag instead.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
CMakeLists.txt
Makefile
externals/CMakeLists.txt

index 02b5257..dd83f69 100644 (file)
@@ -53,6 +53,7 @@ option(DOWNLOAD_FARMHASH "Download farmhash source" ON)
 option(DOWNLOAD_GEMMLOWP "Download GEMM low precesion library source" ON)
 option(DOWNLOAD_NEON2SSE "Download NEON2SSE library source" ON)
 option(DOWNLOAD_FLATBUFFERS "Download FlatBuffers source" ON)
+option(BUILD_TENSORFLOW_LITE "Build TensorFlow Lite from the downloaded source" ON)
 option(DOWNLOAD_ARMCOMPUTE "Download ARM Compute source" ON)
 option(BUILD_ARMCOMPUTE "Build ARM Compute from the downloaded source" ON)
 option(DOWNLOAD_NONIUS "Download nonius source" ON)
@@ -91,10 +92,7 @@ if("${TARGET_OS}" STREQUAL "android")
 
 else("${TARGET_OS}" STREQUAL "android") # General case (non-android build)
 
-  if(NOT OBS_BUILD)
-    add_subdirectory(externals)
-  endif(NOT OBS_BUILD)
-
+  add_subdirectory(externals)
   add_subdirectory(contrib)
   add_subdirectory(libs)
   add_subdirectory(runtimes)
index 56eaa07..accc82e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,8 @@ endif
 
 ifneq ($(OBS_BUILD),OFF)
        OPTIONS+= -DBUILD_ARMCOMPUTE=FALSE
+       # Use pre-installed tensorflow lite library
+       OPTIONS+= -DBUILD_TENSORFLOW_LITE=FALSE
        OPTIONS+= -DBUILD_TOOLS=FALSE
 endif
 
index d68bbb2..4ef3d21 100644 (file)
@@ -1,3 +1,8 @@
+# TODO Rewrite below build script as CMake package
+if(NOT BUILD_TENSORFLOW_LITE)
+  return()
+endif(NOT BUILD_TENSORFLOW_LITE)
+
 set(TENSORFLOW_BASE ${CMAKE_CURRENT_SOURCE_DIR}/tensorflow)
 set(TENSORFLOW_LITE_BASE ${TENSORFLOW_BASE}/tensorflow/contrib/lite)