From c3838bb95a9d65dc5faff856a6cd92fe4b1e3caf Mon Sep 17 00:00:00 2001 From: binsz <274620705z@gmail.com> Date: Wed, 31 Jan 2024 09:04:09 +0800 Subject: [PATCH] use system protobuf --- cmake/external/onnxruntime_external_deps.cmake | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index f78477c..e91a094 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -161,21 +161,7 @@ if(Patch_FOUND) else() set(ONNXRUNTIME_PROTOBUF_PATCH_COMMAND "") endif() -FetchContent_Declare( - Protobuf - URL ${DEP_URL_protobuf} - URL_HASH SHA1=${DEP_SHA1_protobuf} - PATCH_COMMAND ${ONNXRUNTIME_PROTOBUF_PATCH_COMMAND} - FIND_PACKAGE_ARGS 3.21.12 NAMES Protobuf -) -set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests" FORCE) -if (CMAKE_SYSTEM_NAME STREQUAL "Android") - set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL "Build protobuf tests" FORCE) - set(protobuf_WITH_ZLIB OFF CACHE BOOL "Build with zlib support" FORCE) -endif() -if (onnxruntime_DISABLE_RTTI) - set(protobuf_DISABLE_RTTI ON CACHE BOOL "Remove runtime type information in the binaries" FORCE) -endif() +find_package(Protobuf REQUIRED) include(protobuf_function) #protobuf end @@ -317,7 +303,7 @@ FetchContent_Declare( ) # The next line will generate an error message "fatal: not a git repository", but it is ok. It is from flatbuffers -onnxruntime_fetchcontent_makeavailable(Protobuf nlohmann_json mp11 re2 safeint GSL flatbuffers) +onnxruntime_fetchcontent_makeavailable(nlohmann_json mp11 re2 safeint GSL flatbuffers) if(NOT flatbuffers_FOUND) if(NOT TARGET flatbuffers::flatbuffers) add_library(flatbuffers::flatbuffers ALIAS flatbuffers) -- 2.41.0