fix build issue on android on shutdown protobuf (#9615)

* fix build issue on android on shutdown protobuf

* add ie_dependent_option for shutdown protobuf
This commit is contained in:
mei, yang 2022-01-13 16:47:54 +08:00 committed by GitHub
parent 080477aa9c
commit 6ae0ba481e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

View File

@ -150,7 +150,7 @@ macro(ov_add_frontend)
endif() endif()
# Shutdown protobuf when unloading the front dynamic library # Shutdown protobuf when unloading the front dynamic library
if(OV_FRONTEND_SHUTDOWN_PROTOBUF AND BUILD_SHARED_LIBS) if(ENABLE_SHUTDOWN_PROTOBUF AND OV_FRONTEND_SHUTDOWN_PROTOBUF AND BUILD_SHARED_LIBS)
target_link_libraries(${TARGET_NAME} PRIVATE ov_protobuf_shutdown) target_link_libraries(${TARGET_NAME} PRIVATE ov_protobuf_shutdown)
endif() endif()

View File

@ -154,6 +154,8 @@ 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_OV_TF_FRONTEND "Enable TensorFlow FrontEnd" ON "protoc_available" OFF)
ie_dependent_option(ENABLE_SYSTEM_PROTOBUF "Use system protobuf" 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) "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_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 ie_dependent_option(ENABLE_OV_CORE_BACKEND_UNIT_TESTS "Control the building of unit tests using backends" ON
"ENABLE_OV_CORE_UNIT_TESTS" OFF) "ENABLE_OV_CORE_UNIT_TESTS" OFF)

View File

@ -71,4 +71,6 @@ install(DIRECTORY ${FRONTEND_INCLUDE_DIR}/openvino
# Shutdown protobuf library # Shutdown protobuf library
add_subdirectory(shutdown_protobuf) if(ENABLE_SHUTDOWN_PROTOBUF)
add_subdirectory(shutdown_protobuf)
endif()

View File

@ -1,4 +1,4 @@
set(TARGET_NAME ov_protobuf_shutdown) set(TARGET_NAME ov_protobuf_shutdown)
add_library(${TARGET_NAME} STATIC shutdown_protobuf.cpp) add_library(${TARGET_NAME} STATIC shutdown_protobuf.cpp)
target_sources(${TARGET_NAME} INTERFACE shutdown_protobuf.cpp) target_sources(${TARGET_NAME} INTERFACE shutdown_protobuf.cpp)
target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${Protobuf_INCLUDE_DIRS}) target_include_directories(${TARGET_NAME} SYSTEM PRIVATE $<BUILD_INTERFACE:${Protobuf_INCLUDE_DIRS}>)