Fix build problem with protoc (#66)
author박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Mon, 19 Mar 2018 07:47:04 +0000 (16:47 +0900)
committer서상민/동작제어Lab(SR)/Senior Engineer/삼성전자 <sangmin7.seo@samsung.com>
Mon, 19 Mar 2018 07:47:04 +0000 (16:47 +0900)
* Fix build problem with protoc

This will fix arm cross build problem with protoc that may not be needed in target device

* add protobuf_BUILD_TESTS inside if clause

externals/CMakeLists.txt
tools/CMakeLists.txt

index 210ffe6..adacdce 100644 (file)
@@ -28,14 +28,15 @@ target_include_directories(eigen3 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/eigen")
 #
 # Protocol Buffer (>= 3.5.1)
 #
-set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build tests" FORCE)
+# TODO add protobuf for arm cross build
+if(ROOTFS_ARM STREQUAL "")
+  set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build tests" FORCE)
 
-add_subdirectory(protobuf/cmake)
+  add_subdirectory(protobuf/cmake)
 
 #
 # TensorFlow Graph Definition Accessor
 #
-# TODO Reduce indentation level
   list(APPEND TF_GRAPH_PROTO_TAGS tensorflow/core/framework/versions)
   list(APPEND TF_GRAPH_PROTO_TAGS tensorflow/core/framework/function)
   list(APPEND TF_GRAPH_PROTO_TAGS tensorflow/core/framework/types)
@@ -60,6 +61,7 @@ add_subdirectory(protobuf/cmake)
   add_library(tensorflow_graphdef ${TF_GRAPH_PROTO_SRCS})
   target_include_directories(tensorflow_graphdef PUBLIC ${TF_GRAPH_PROTO_GENERATED})
   target_link_libraries(tensorflow_graphdef PUBLIC libprotobuf)
+endif()
 
 #
 # Tensorflow Lite library
index ab88628..ea8370f 100644 (file)
@@ -1,3 +1,6 @@
-add_subdirectory(graphdump)
+# TODO add graphdump for arm cross build
+if(ROOTFS_ARM STREQUAL "")
+  add_subdirectory(graphdump)
+endif()
 add_subdirectory(tflite_run)
 add_subdirectory(nnapi_bindings)