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