Fixed build without protobuf-lite (#19164)

This commit is contained in:
Ilya Lavrenov 2023-08-14 11:57:35 +04:00 committed by GitHub
parent f09d2e2666
commit aebf1edec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -201,6 +201,10 @@ macro(ov_add_frontend)
if(FORCE_FRONTENDS_USE_PROTOBUF) if(FORCE_FRONTENDS_USE_PROTOBUF)
set(OV_FRONTEND_PROTOBUF_LITE OFF) set(OV_FRONTEND_PROTOBUF_LITE OFF)
endif() endif()
# if protobuf::libprotobuf-lite is not available, use protobuf::libprotobuf
if(NOT TARGET protobuf::libprotobuf-lite)
set(OV_FRONTEND_PROTOBUF_LITE OFF)
endif()
if(proto_files) if(proto_files)
if(OV_FRONTEND_PROTOBUF_LITE) if(OV_FRONTEND_PROTOBUF_LITE)

View File

@ -435,7 +435,7 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND
set(Protobuf_IN_FRONTEND ON) set(Protobuf_IN_FRONTEND ON)
# set public / interface compile options # set public / interface compile options
foreach(target_name protobuf::libprotobuf protobuf::libprotobuf-lite) function(_ov_fix_protobuf_warnings target_name)
set(link_type PUBLIC) set(link_type PUBLIC)
if(ENABLE_SYSTEM_PROTOBUF) if(ENABLE_SYSTEM_PROTOBUF)
set(link_type INTERFACE) set(link_type INTERFACE)
@ -448,7 +448,12 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND
endif() endif()
target_compile_options(${target_name} ${link_type} -Wno-undef) target_compile_options(${target_name} ${link_type} -Wno-undef)
endif() endif()
endforeach() endfunction()
_ov_fix_protobuf_warnings(protobuf::libprotobuf)
if(TARGET protobuf::libprotobuf-lite)
_ov_fix_protobuf_warnings(protobuf::libprotobuf-lite)
endif()
endif() endif()
# #