From 10a1661c5eb8850ede0088d5dd7a0e68d81550f9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=84=B8=ED=9D=AC/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Principal=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Mon, 19 Mar 2018 16:47:04 +0900 Subject: [PATCH] Fix build problem with protoc (#66) * 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 | 8 +++++--- tools/CMakeLists.txt | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 210ffe6..adacdce 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -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 diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index ab88628..ea8370f 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -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) -- 2.7.4