diff --git a/src/frontends/onnx/onnx_common/CMakeLists.txt b/src/frontends/onnx/onnx_common/CMakeLists.txt index ef3d4ce3c1a..4c4c5b0100d 100644 --- a/src/frontends/onnx/onnx_common/CMakeLists.txt +++ b/src/frontends/onnx/onnx_common/CMakeLists.txt @@ -23,18 +23,15 @@ set_target_properties(${TARGET_NAME} PROPERTIES set(ONNX_COMMON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) set(ONNX_COMMON_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) -target_include_directories(${TARGET_NAME} PUBLIC $ - $) +target_include_directories(${TARGET_NAME} + PUBLIC $ + $ + PRIVATE ${ONNX_COMMON_SRC_DIR}) target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime) -if(ONNX_USE_LITE_PROTO) - link_system_libraries(${TARGET_NAME} PUBLIC onnx_proto onnx protobuf::libprotobuf-lite) -else() - link_system_libraries(${TARGET_NAME} PUBLIC onnx_proto onnx protobuf::libprotobuf) -endif() +link_system_libraries(${TARGET_NAME} PUBLIC onnx_proto onnx) -target_include_directories(${TARGET_NAME} PRIVATE ${ONNX_COMMON_SRC_DIR}) add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}) ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) diff --git a/src/frontends/onnx/onnx_common/src/utils.cpp b/src/frontends/onnx/onnx_common/src/utils.cpp index ad2c6c9ee6b..eab9d7d929f 100644 --- a/src/frontends/onnx/onnx_common/src/utils.cpp +++ b/src/frontends/onnx/onnx_common/src/utils.cpp @@ -65,7 +65,7 @@ const std::map NG_2_ONNX_TYPES = { {element::Type_t::boolean, TensorProto_DataType::TensorProto_DataType_BOOL}}; } // namespace -element::Type_t onnx_to_ng_data_type(const TensorProto_DataType& onnx_type) { +element::Type_t onnx_to_ng_data_type(const ONNX_NAMESPACE::TensorProto_DataType& onnx_type) { const auto result = std::find_if(NG_2_ONNX_TYPES.begin(), NG_2_ONNX_TYPES.end(), diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmake index 0be8a7cf30e..3b9d9dc5b0f 100644 --- a/thirdparty/dependencies.cmake +++ b/thirdparty/dependencies.cmake @@ -409,7 +409,9 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND if(ENABLE_SYSTEM_PROTOBUF) # Note: Debian / Ubuntu / RHEL libprotobuf.a can only be used with -DBUILD_SHARED_LIBS=OFF # because they are compiled without -fPIC - set(Protobuf_USE_STATIC_LIBS ON) + if(NOT DEFINED Protobuf_USE_STATIC_LIBS) + set(Protobuf_USE_STATIC_LIBS ON) + endif() if(CMAKE_VERBOSE_MAKEFILE) set(Protobuf_DEBUG ON) endif()