Ignore unused-variable for libprotoc (#4948)

* ignore unused-variable for libprotoc

* move apply Wno-unused-variable

* apply Wno-unused-variable only if libprotoc is available
This commit is contained in:
Mateusz Bencer 2021-03-27 13:49:18 +01:00 committed by GitHub
parent 8a3ff9aeae
commit a0b06303cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -92,6 +92,8 @@ else()
set(_proto_libs ${Protobuf_LIBRARIES})
if(TARGET libprotoc)
list(APPEND _proto_libs libprotoc)
set_target_properties(libprotoc PROPERTIES
COMPILE_FLAGS "-Wno-unused-variable")
endif()
set_target_properties(${_proto_libs} PROPERTIES
CXX_VISIBILITY_PRESET default
@ -100,6 +102,7 @@ else()
set_target_properties(libprotobuf libprotobuf-lite PROPERTIES
COMPILE_FLAGS "-Wno-unused-variable -Wno-inconsistent-missing-override")
endif()
if(NGRAPH_USE_PROTOBUF_LITE)
# if only libprotobuf-lite is used, both libprotobuf and libprotobuf-lite are built
# libprotoc target needs symbols from libprotobuf, even in libprotobuf-lite configuration