From 0660179bf2a39e1d43ebdb638c08ffb6a9e88a9a Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 21 Jul 2021 13:56:55 +0300 Subject: [PATCH] Fixed build with protobuf-lite (#6730) --- thirdparty/CMakeLists.txt | 2 +- thirdparty/protobuf/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index a65fdb2e56680d..d35947dca9e38b 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -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() diff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txt index c4d6fe26bc2af6..f3cec9914a16f5 100644 --- a/thirdparty/protobuf/CMakeLists.txt +++ b/thirdparty/protobuf/CMakeLists.txt @@ -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