Fixed build with protobuf-lite (#6730)

This commit is contained in:
Ilya Lavrenov 2021-07-21 13:56:55 +03:00 committed by GitHub
parent 11875c6694
commit ecb5499702
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -158,7 +158,7 @@ if(NGRAPH_PDPD_FRONTEND_ENABLE OR NGRAPH_ONNX_IMPORT_ENABLE)
if(NGRAPH_USE_SYSTEM_PROTOBUF)
set(link_type INTERFACE)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
target_compile_options(${target} ${link_type} -Wno-undef)
endif()
endforeach()

View File

@ -63,6 +63,8 @@ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
if(TARGET libprotoc)
list(APPEND _proto_libs libprotoc)
target_compile_options(libprotoc PRIVATE -Wno-all -Wno-unused-variable)
# libprotobuf is always built for protoc
target_compile_options(libprotobuf PUBLIC -Wno-undef)
endif()
set_target_properties(${_proto_libs} PROPERTIES
CXX_VISIBILITY_PRESET default