Added a gRPC_BUILD_TESTS guard to third_party protos

pull/38179/head
Esun Kim 3 months ago
parent c6dccd4cb1
commit b8c9ca965d
  1. 5
      CMakeLists.txt
  2. 14
      templates/CMakeLists.txt.template

5
CMakeLists.txt generated

@ -776,6 +776,10 @@ protobuf_generate_grpc_cpp_with_import_path_correction(
protobuf_generate_grpc_cpp_with_import_path_correction(
test/core/tsi/alts/fake_handshaker/transport_security_common.proto test/core/tsi/alts/fake_handshaker/transport_security_common.proto
)
# This enables CMake to build the project without requiring submodules
# in the third_party directory as long as test builds are disabled.
if (gRPC_BUILD_TESTS)
protobuf_generate_grpc_cpp_with_import_path_correction(
third_party/envoy-api/envoy/admin/v3/certs.proto envoy/admin/v3/certs.proto
)
@ -1235,6 +1239,7 @@ protobuf_generate_grpc_cpp_with_import_path_correction(
protobuf_generate_grpc_cpp_with_import_path_correction(
third_party/xds/xds/type/v3/typed_struct.proto xds/type/v3/typed_struct.proto
)
endif()
if(gRPC_BUILD_TESTS)
add_custom_target(buildtests_c)

@ -713,11 +713,25 @@
DEPENDS tools_c tools_cxx)
% for src in sorted(protobuf_gen_files):
% if not src.startswith('third_party/'):
protobuf_generate_grpc_cpp_with_import_path_correction(
${src} ${third_party_proto_import_path(src)}
)
% endif
% endfor
# This enables CMake to build the project without requiring submodules
# in the third_party directory as long as test builds are disabled.
if (gRPC_BUILD_TESTS)
% for src in sorted(protobuf_gen_files):
% if src.startswith('third_party/'):
protobuf_generate_grpc_cpp_with_import_path_correction(
${src} ${third_party_proto_import_path(src)}
)
% endif
% endfor
endif()
if(gRPC_BUILD_TESTS)
add_custom_target(buildtests_c)
% for tgt in targets:

Loading…
Cancel
Save