Simplify tests/tools/CMakeLists.txt (#4670)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 11 Mar 2019 11:15:32 +0000 (20:15 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 11 Mar 2019 11:15:32 +0000 (20:15 +0900)
This commit introduces BUILD_TFLITE_RUN option in order to simplify
"tests/tools/CMakeLists.txt".

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
Makefile
cmake/CfgOptionFlags.cmake
tests/tools/CMakeLists.txt
tests/tools/tflite_run/CMakeLists.txt

index accc82e..e7df9c2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -57,6 +57,9 @@ ifneq ($(OBS_BUILD),OFF)
        # Use pre-installed tensorflow lite library
        OPTIONS+= -DBUILD_TENSORFLOW_LITE=FALSE
        OPTIONS+= -DBUILD_TOOLS=FALSE
+       # Disable "tflite-run" and "tflite_benchmark_model" for Tizen
+       OPTIONS+= -DBUILD_TFLITE_RUN=FALSE
+       OPTIONS+= -DBUILD_TFLITE_BENCHMARK_MODEL=FALSE
 endif
 
 ifeq ($(GENERATE_NNAPI_TESTS),1)
index 380737a..91a6867 100644 (file)
@@ -12,6 +12,7 @@ CMAKE_DEPENDENT_OPTION(BUILD_RUNTIME_NNAPI_TEST "Build Runtime NN API Generated
                        ON "CMAKE_COMPILER_IS_GNUCC;NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.2"
                        # Otherwise set BUILD_RUNTIME_NNAPI_TEST as OFF
                        OFF)
+option(BUILD_TFLITE_RUN "Build tflite-run" ON)
 option(BUILD_TFLITE_BENCHMARK_MODEL "Build tflite benchmark model" OFF)
 option(BUILD_NNAPI_QUICKCHECK "Build NN API Quickcheck tools" OFF)
 #
index b1eea12..5ea6cda 100644 (file)
@@ -1,8 +1 @@
-set(EXCLUDE_DIR "")
-
-if(OBS_BUILD)
-  list(APPEND EXCLUDE_DIR tflite_benchmark_model)
-  list(APPEND EXCLUDE_DIR tflite_run)
-endif(OBS_BUILD)
-
-add_subdirectories(EXCLUDES ${EXCLUDE_DIR})
+add_subdirectories()
index bbfaede..aae027c 100644 (file)
@@ -1,3 +1,7 @@
+if(NOT BUILD_TFLITE_RUN)
+  return()
+endif(NOT BUILD_TFLITE_RUN)
+
 list(APPEND TFLITE_RUN_SRCS "src/tflite_run.cc")
 list(APPEND TFLITE_RUN_SRCS "src/bin_image.cc")
 list(APPEND TFLITE_RUN_SRCS "src/args.cc")