diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ccda85b125..f504980e1ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3828,6 +3828,7 @@ foreach(_hdr endforeach() endif (gRPC_BUILD_CODEGEN) +if (gRPC_BUILD_CODEGEN) if (gRPC_INSTALL) install(TARGETS grpc++_error_details EXPORT gRPCTargets @@ -3837,6 +3838,7 @@ if (gRPC_INSTALL) ) endif() +endif (gRPC_BUILD_CODEGEN) if (gRPC_BUILD_TESTS) if (gRPC_BUILD_CODEGEN) @@ -3958,6 +3960,7 @@ foreach(_hdr endforeach() endif (gRPC_BUILD_CODEGEN) +if (gRPC_BUILD_CODEGEN) if (gRPC_INSTALL) install(TARGETS grpc++_reflection EXPORT gRPCTargets @@ -3967,6 +3970,7 @@ if (gRPC_INSTALL) ) endif() +endif (gRPC_BUILD_CODEGEN) if (gRPC_BUILD_TESTS) add_library(grpc++_test_config @@ -4959,6 +4963,7 @@ foreach(_hdr endforeach() endif (gRPC_BUILD_CODEGEN) +if (gRPC_BUILD_CODEGEN) if (gRPC_INSTALL) install(TARGETS grpcpp_channelz EXPORT gRPCTargets @@ -4968,6 +4973,7 @@ if (gRPC_INSTALL) ) endif() +endif (gRPC_BUILD_CODEGEN) if (gRPC_BUILD_TESTS) if (gRPC_BUILD_CODEGEN) diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index e7fdfe5de55..dd996d736ac 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -331,12 +331,24 @@ % elif lib.name in ['grpc_csharp_ext']: if (gRPC_BUILD_CSHARP_EXT) ${cc_library(lib)} + % if any(proto_re.match(src) for src in lib.src): + if (gRPC_BUILD_CODEGEN) + % endif ${cc_install(lib)} + % if any(proto_re.match(src) for src in lib.src): + endif (gRPC_BUILD_CODEGEN) + % endif endif (gRPC_BUILD_CSHARP_EXT) % else: ${cc_library(lib)} % if not lib.build in ["tool"]: + % if any(proto_re.match(src) for src in lib.src): + if (gRPC_BUILD_CODEGEN) + % endif ${cc_install(lib)} + % if any(proto_re.match(src) for src in lib.src): + endif (gRPC_BUILD_CODEGEN) + % endif % endif % endif % endif