From 2837d000e993f5727b0b9649a0ec69f08b89d04d Mon Sep 17 00:00:00 2001 From: Zack Galbreath Date: Mon, 11 Nov 2019 11:42:27 -0500 Subject: [PATCH 1/2] Do not build channelz when gRPC_USE_PROTO_LITE --- CMakeLists.txt | 2 +- templates/CMakeLists.txt.template | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6da566a87a..1bb36c267dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4831,7 +4831,7 @@ if(gRPC_INSTALL) endif() -if(gRPC_BUILD_CODEGEN) +if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) add_library(grpcpp_channelz src/cpp/server/channelz/channelz_service.cc src/cpp/server/channelz/channelz_service_plugin.cc diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 923cda9b34c..0e064c51409 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -438,8 +438,12 @@ <%def name="cc_library(lib)"> % if any(proto_re.match(src) for src in lib.src): + % if lib.name == 'grpcpp_channelz': + if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) + % else: if(gRPC_BUILD_CODEGEN) % endif + % endif add_library(${lib.name}${' SHARED' if lib.get('dll', None) == 'only' else ''} % for src in lib.src: % if not proto_re.match(src): From 44b28e0c98ed79ebc36fefb834165463cf087af7 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 14 Nov 2019 08:36:03 -0500 Subject: [PATCH 2/2] add a comment --- CMakeLists.txt | 2 ++ templates/CMakeLists.txt.template | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bb36c267dd..9e5eb0d1c72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4831,6 +4831,8 @@ if(gRPC_INSTALL) endif() +# grpcpp_channelz doesn't build with protobuf-lite +# See https://github.com/grpc/grpc/issues/19473 if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) add_library(grpcpp_channelz src/cpp/server/channelz/channelz_service.cc diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 0e064c51409..281c2522668 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -439,6 +439,8 @@ <%def name="cc_library(lib)"> % if any(proto_re.match(src) for src in lib.src): % if lib.name == 'grpcpp_channelz': + # grpcpp_channelz doesn't build with protobuf-lite + # See https://github.com/grpc/grpc/issues/19473 if(gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE) % else: if(gRPC_BUILD_CODEGEN)