diff --git a/CMakeLists.txt b/CMakeLists.txt index b830e513cb2b3..92f12e2868912 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3800,7 +3800,9 @@ endif() if(gRPC_BUILD_CODEGEN) -if(gRPC_INSTALL) +# grpcpp_channelz doesn't build with protobuf-lite, so no install required +# See https://github.com/grpc/grpc/issues/22826 +if(gRPC_INSTALL AND NOT gRPC_USE_PROTO_LITE) install(TARGETS grpcpp_channelz EXPORT gRPCTargets RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index 40cf7ff615d8c..cef2534cbd126 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -685,7 +685,13 @@ <%def name="cc_install(tgt)"> + % if tgt.name == 'grpcpp_channelz': + # grpcpp_channelz doesn't build with protobuf-lite, so no install required + # See https://github.com/grpc/grpc/issues/22826 + if(gRPC_INSTALL AND NOT gRPC_USE_PROTO_LITE) + % else: if(gRPC_INSTALL) + % endif install(TARGETS ${tgt.name} EXPORT gRPCTargets RUNTIME DESTINATION <%text>${gRPC_INSTALL_BINDIR} LIBRARY DESTINATION <%text>${gRPC_INSTALL_LIBDIR}