pw_protobuf_compiler: Add missing dependency
This change fixes the GN target for a generated nanopb_rpc proto library
to properly depend on its corresponding nanopb library.
Change-Id: Ibd7a9035f0cdd7406e4c8fd9ab9504972ae07876
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13800
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
diff --git a/pw_protobuf_compiler/proto.gni b/pw_protobuf_compiler/proto.gni
index b9edfad..7eba431 100644
--- a/pw_protobuf_compiler/proto.gni
+++ b/pw_protobuf_compiler/proto.gni
@@ -358,11 +358,17 @@
foreach(_gen, _generators) {
_lang_target = "${target_name}_${_gen}"
_gen_deps = []
+
+ if (_gen == "nanopb_rpc") {
+ # Generated RPC code depends on the library's core protos.
+ _gen_deps += [ ":${target_name}_nanopb" ]
+ }
+
if (defined(invoker.deps)) {
_gen_deps = process_file_template(invoker.deps, "{{source}}_${_gen}")
if (_gen == "nanopb_rpc") {
- # Generated RPC code also depends on the core generated protos.
+ # RPC dependencies also depend on their core generated protos.
_gen_deps += process_file_template(invoker.deps, "{{source}}_nanopb")
}
}