Skip to content

Commit

Permalink
Make C++ proto library work over targets that aren't proto_library
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 674353486
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Sep 13, 2024
1 parent 23eb616 commit af1ba90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bazel/private/cc_proto_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def cc_proto_compile_and_link(ctx, deps, sources, headers, disallow_dynamic_libr
cc_toolchain = cc_toolchain,
srcs = sources,
public_hdrs = headers,
compilation_contexts = [dep[CcInfo].compilation_context for dep in deps],
compilation_contexts = [dep[CcInfo].compilation_context for dep in deps if CcInfo in dep],
name = ctx.label.name,
# Don't instrument the generated C++ files even when --collect_code_coverage is set.
# If we actually start generating coverage instrumentation for .proto files based on coverage
Expand All @@ -113,7 +113,7 @@ def cc_proto_compile_and_link(ctx, deps, sources, headers, disallow_dynamic_libr
feature_configuration = feature_configuration,
cc_toolchain = cc_toolchain,
compilation_outputs = compilation_outputs,
linking_contexts = [dep[CcInfo].linking_context for dep in deps],
linking_contexts = [dep[CcInfo].linking_context for dep in deps if CcInfo in dep],
name = ctx.label.name,
disallow_dynamic_library = disallow_dynamic_library,
alwayslink = alwayslink,
Expand Down

0 comments on commit af1ba90

Please sign in to comment.