From 51c32c1a276f9882e06a3a1ba14ca7457917bdd4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 31 Jan 2019 08:55:52 +0900 Subject: [PATCH] Use Protocol Buffer 3.5.2 (#2963) This commit integrates protocol buffer 3.5.2 (instead of 3.6.1) as a nncc external package. Signed-off-by: Jonghyun Park --- CMakeLists.txt | 2 +- cmake/packages/ProtobufConfig.cmake | 10 ++++------ cmake/packages/ProtobufSourceConfig.cmake | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index abd31fe..859c017 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ message(STATUS "Use '${CMAKE_BUILD_TYPE}' configuration") ### Configuration ### option(DOWNLOAD_PROTOBUF "Download Protocol Buffer source" ON) -option(BUILD_PROTOBUF "Locally build Protocol Buffer from the downloaded source" OFF) +option(BUILD_PROTOBUF "Locally build Protocol Buffer from the downloaded source" ON) option(DOWNLOAD_EIGEN "Download Eigen source" ON) option(DOWNLOAD_FARMHASH "Download farmhash source" ON) option(DOWNLOAD_GEMMLOWP "Download GEMM low precesion library source" ON) diff --git a/cmake/packages/ProtobufConfig.cmake b/cmake/packages/ProtobufConfig.cmake index 2bacde6..ddd7c4d 100644 --- a/cmake/packages/ProtobufConfig.cmake +++ b/cmake/packages/ProtobufConfig.cmake @@ -1,4 +1,4 @@ -# TODO Use CONFIG version after bug fix +# NOTE This function is unused, but remains for future reference function(_Protobuf_module_import) # Let's use find_package here not to export unnecessary definitions find_package(Protobuf MODULE QUIET) @@ -25,7 +25,7 @@ endfunction(_Protobuf_module_import) function(_Protobuf_import) # Let's use find_package here not to export unnecessary definitions # NOTE Here we use "exact" match to avoid possible infinite loop - find_package(Protobuf EXACT 3.6.1) + find_package(protobuf EXACT 3.5.2 QUIET) if(NOT protobuf_FOUND) set(Protobuf_FOUND FALSE PARENT_SCOPE) @@ -102,10 +102,8 @@ function(_Protobuf_build) message(STATUS "Succeeded in building Protocol Buffer") endfunction(_Protobuf_build) -# TODO Use Protocol Buffer 3.6.1 _Protobuf_build() -#_Protobuf_import() -_Protobuf_module_import() +_Protobuf_import() if(Protobuf_FOUND) function(Protobuf_Generate PREFIX OUTPUT_DIR PROTO_DIR) @@ -128,7 +126,7 @@ if(Protobuf_FOUND) add_custom_command(OUTPUT ${OUTPUT_FILES} COMMAND ${CMAKE_COMMAND} -E make_directory "${abs_output_dir}" - COMMAND "$" --cpp_out "${abs_output_dir}" -I "${abs_proto_dir}" ${PROTO_FILES} + COMMAND "$" --cpp_out "${abs_output_dir}" -I "${abs_proto_dir}" ${PROTO_FILES} DEPENDS ${PROTO_FILES}) set(${PREFIX}_SOURCES ${OUTPUT_FILES} PARENT_SCOPE) diff --git a/cmake/packages/ProtobufSourceConfig.cmake b/cmake/packages/ProtobufSourceConfig.cmake index fa95f39..89176eb 100644 --- a/cmake/packages/ProtobufSourceConfig.cmake +++ b/cmake/packages/ProtobufSourceConfig.cmake @@ -7,7 +7,7 @@ function(_ProtobufSource_import) nncc_include(ExternalSourceTools) nncc_include(OptionTools) - envoption(PROTOBUF_URL https://github.com/protocolbuffers/protobuf/archive/v3.6.1.tar.gz) + envoption(PROTOBUF_URL https://github.com/protocolbuffers/protobuf/archive/v3.5.2.tar.gz) ExternalSource_Download(PROTOBUF ${PROTOBUF_URL}) -- 2.7.4