From e6d062e3950ce3220b7da9022cd296f55831c73a Mon Sep 17 00:00:00 2001 From: "mei, yang" Date: Fri, 14 Jan 2022 10:02:26 +0800 Subject: [PATCH] remove option ENABLE_SHUTDOWN_PROTOBUF (#9619) * remove option ENABLE_SHUTDOWN_PROTOBUF * shutdown protobuf library is enabled automatically if protobuf is used in frontend --- cmake/developer_package/frontends/frontends.cmake | 2 +- cmake/features.cmake | 2 -- src/frontends/common/CMakeLists.txt | 2 +- thirdparty/CMakeLists.txt | 1 + 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake index dc1fbc0d87c..f662332b4c7 100644 --- a/cmake/developer_package/frontends/frontends.cmake +++ b/cmake/developer_package/frontends/frontends.cmake @@ -150,7 +150,7 @@ macro(ov_add_frontend) endif() # Shutdown protobuf when unloading the front dynamic library - if(ENABLE_SHUTDOWN_PROTOBUF AND OV_FRONTEND_SHUTDOWN_PROTOBUF AND BUILD_SHARED_LIBS) + if(OV_FRONTEND_SHUTDOWN_PROTOBUF AND BUILD_SHARED_LIBS) target_link_libraries(${TARGET_NAME} PRIVATE ov_protobuf_shutdown) endif() diff --git a/cmake/features.cmake b/cmake/features.cmake index 2cafef44c7c..e1655250327 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -154,8 +154,6 @@ ie_option(ENABLE_OV_IR_FRONTEND "Enable IR FrontEnd" ON) ie_dependent_option(ENABLE_OV_TF_FRONTEND "Enable TensorFlow FrontEnd" ON "protoc_available" OFF) ie_dependent_option(ENABLE_SYSTEM_PROTOBUF "Use system protobuf" OFF "ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_TF_FRONTEND;BUILD_SHARED_LIBS" OFF) -ie_dependent_option(ENABLE_SHUTDOWN_PROTOBUF "Shutdown protobuf when unload the frontend shared libraries" ON - "ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_TF_FRONTEND;BUILD_SHARED_LIBS" OFF) ie_dependent_option(ENABLE_OV_CORE_UNIT_TESTS "Enables OpenVINO core unit tests" ON "ENABLE_TESTS;NOT ANDROID" OFF) ie_dependent_option(ENABLE_OV_CORE_BACKEND_UNIT_TESTS "Control the building of unit tests using backends" ON "ENABLE_OV_CORE_UNIT_TESTS" OFF) diff --git a/src/frontends/common/CMakeLists.txt b/src/frontends/common/CMakeLists.txt index 00fea28bf87..0019fea3513 100644 --- a/src/frontends/common/CMakeLists.txt +++ b/src/frontends/common/CMakeLists.txt @@ -71,6 +71,6 @@ install(DIRECTORY ${FRONTEND_INCLUDE_DIR}/openvino # Shutdown protobuf library -if(ENABLE_SHUTDOWN_PROTOBUF) +if(Protobuf_IN_FRONTEND AND BUILD_SHARED_LIBS) add_subdirectory(shutdown_protobuf) endif() diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index bc4d8caa93e..d4804401460 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -107,6 +107,7 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND set(Protobuf_LIBRARIES ${Protobuf_LIBRARIES} PARENT_SCOPE) set(Protobuf_LITE_LIBRARIES ${Protobuf_LITE_LIBRARIES} PARENT_SCOPE) set(Protobuf_INCLUDE_DIRS ${Protobuf_INCLUDE_DIRS} PARENT_SCOPE) + set(Protobuf_IN_FRONTEND ON PARENT_SCOPE) # set public / interface compile options foreach(target IN LISTS Protobuf_LITE_LIBRARIES Protobuf_LIBRARIES)