xref: /aosp_15_r20/external/pigweed/pw_rpc/Android.bp (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1// Copyright 2022 The Pigweed Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4// use this file except in compliance with the License. You may obtain a copy of
5// the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12// License for the specific language governing permissions and limitations under
13// the License.
14
15package {
16    default_applicable_licenses: ["external_pigweed_license"],
17}
18
19java_library {
20    name: "pw_rpc_java_client",
21    srcs: ["java/main/dev/pigweed/pw_rpc/*.java"],
22    visibility: ["//visibility:public"],
23    static_libs: [
24        "pw_log_android_java",
25        "pw_rpc_packet_proto_java_lite",
26    ],
27    libs: [
28        "auto_value_annotations",
29        "guava",
30        "jsr305",
31        "libprotobuf-java-lite",
32    ],
33    plugins: ["auto_value_plugin"],
34    sdk_version: "current",
35}
36
37java_library_static {
38    name: "pw_rpc_packet_proto_java_lite",
39    host_supported: true,
40    proto: {
41        type: "lite",
42    },
43    srcs: ["internal/packet.proto"],
44    sdk_version: "current",
45}
46
47java_library_static {
48    name: "pw_rpc_echo_proto_java_lite",
49    visibility: ["//visibility:public"],
50    host_supported: true,
51    proto: {
52        type: "lite",
53    },
54    srcs: ["echo.proto"],
55    sdk_version: "current",
56}
57
58filegroup {
59    name: "pw_rpc_src_files",
60    srcs: [
61        "call.cc",
62        "channel.cc",
63        "channel_list.cc",
64        "client.cc",
65        "client_call.cc",
66        "client_server.cc",
67        "endpoint.cc",
68        "fake_channel_output.cc",
69        "packet.cc",
70        "packet_meta.cc",
71        "server.cc",
72        "server_call.cc",
73        "service.cc",
74    ],
75}
76
77// Do not use this directly. It is used by the pw_rpc_defaults to keep the
78// path to the "public" directory relative to this module.
79cc_library_headers {
80    name: "pw_rpc_include_dirs",
81    export_include_dirs: [
82        "public",
83    ],
84    vendor_available: true,
85    host_supported: true,
86}
87
88// This rule must be instantiated, i.e.
89//
90//   cc_library_static {
91//       name: "pw_rpc_<instance_name>",
92//       defaults: [
93//           "pw_rpc_cflags_<instance_name>",
94//           "pw_rpc_defaults",
95//       ],
96//   }
97//
98// where pw_rpc_cflags_<instance_name> defines your flags, i.e.
99//
100//   cc_defaults {
101//       name: "pw_rpc_cflags_<instance_name>",
102//       cflags: [
103//           "-DPW_RPC_USE_GLOBAL_MUTEX=0",
104//           "-DPW_RPC_COMPLETION_REQUEST_CALLBACK",
105//           "-DPW_RPC_DYNAMIC_ALLOCATION",
106//       ],
107//   }
108//
109// see pw_rpc_nanopb_defaults, pw_rpc_raw_defaults
110cc_defaults {
111    name: "pw_rpc_defaults",
112    cpp_std: "c++20",
113    defaults: [
114        "pw_android_common_backends",
115    ],
116    header_libs: [
117        "fuchsia_sdk_lib_fit",
118        "fuchsia_sdk_lib_stdcompat",
119        "pw_assert",
120        "pw_log",
121        "pw_rpc_include_dirs",
122        "pw_sync",
123    ],
124    export_header_lib_headers: [
125        "fuchsia_sdk_lib_fit",
126        "fuchsia_sdk_lib_stdcompat",
127        "pw_assert",
128        "pw_log",
129        "pw_rpc_include_dirs",
130        "pw_sync",
131    ],
132    static_libs: [
133        "pw_bytes",
134        "pw_containers",
135        "pw_function",
136        "pw_polyfill",
137        "pw_preprocessor",
138        "pw_protobuf",
139        "pw_result",
140        "pw_span",
141        "pw_status",
142        "pw_stream",
143        "pw_string",
144        "pw_sync_baremetal",
145        "pw_toolchain",
146        "pw_varint",
147    ],
148    export_static_lib_headers: [
149        "pw_bytes",
150        "pw_containers",
151        "pw_function",
152        "pw_polyfill",
153        "pw_preprocessor",
154        "pw_protobuf",
155        "pw_result",
156        "pw_span",
157        "pw_status",
158        "pw_stream",
159        "pw_string",
160        "pw_sync_baremetal",
161        "pw_toolchain",
162        "pw_varint",
163    ],
164    generated_headers: [
165        "pw_rpc_internal_packet_pwpb_h",
166    ],
167    export_generated_headers: [
168        "pw_rpc_internal_packet_pwpb_h",
169    ],
170    srcs: [
171        ":pw_rpc_src_files",
172    ],
173}
174
175genrule {
176    name: "pw_rpc_internal_packet_pwpb_h",
177    srcs: ["internal/packet.proto"],
178    cmd: "python3 $(location pw_protobuf_compiler_py) " +
179        "--out-dir=$$(dirname $(location pw_rpc/internal/packet.pwpb.h)) " +
180        "--plugin-path=$(location pw_protobuf_plugin_py) " +
181        "--compile-dir=$$(dirname $(in)) " +
182        "--sources $(in) " +
183        "--language pwpb " +
184        "--no-experimental-proto3-optional " +
185        "--no-experimental-editions " +
186        "--pwpb-no-oneof-callbacks " +
187        "--protoc=$(location aprotoc) ",
188    out: [
189        "pw_rpc/internal/packet.pwpb.h",
190    ],
191    tools: [
192        "aprotoc",
193        "pw_protobuf_plugin_py",
194        "pw_protobuf_compiler_py",
195    ],
196}
197
198genrule {
199    name: "pw_rpc_internal_packet_py",
200    srcs: ["internal/packet.proto"],
201    cmd: "python3 $(location pw_protobuf_compiler_py) " +
202        "--out-dir=$(genDir) " +
203        "--compile-dir=$$(dirname $(in)) " +
204        "--sources $(in) " +
205        "--language python " +
206        "--no-generate-type-hints " +
207        "--no-experimental-proto3-optional " +
208        "--no-experimental-editions " +
209        "--pwpb-no-oneof-callbacks " +
210        "--protoc=$(location aprotoc)",
211    out: [
212        "packet_pb2.py",
213    ],
214    tools: [
215        "aprotoc",
216        "pw_protobuf_compiler_py",
217    ],
218}
219
220// Generates .pb.c and .pb.h nanopb files.
221// The output file name is based on the srcs file name with an added extension.
222// All dependencies, including .options files, must be listed in srcs and cannot
223// be prefixed. Use the _with_prefix rules if prefixed. Only .proto files are
224// passed to the compile script.
225//
226// Args:
227//   srcs: The list of source files without a prefix.
228//   out: A one-element list with the output file without a prefix.
229genrule_defaults {
230    name: "pw_rpc_generate_nanopb_proto",
231    cmd: "in_files=($(in)); compile_dir=$$(dirname $${in_files[0]}); " +
232        "proto_files=(); " +
233        "for f in \"$${in_files[@]}\"; do " +
234        "if [[ \"$${f##*.}\" == \"proto\" ]]; then " +
235        "proto_files+=(\"$${f}\"); " +
236        "fi; done; " +
237        "python3 $(location pw_protobuf_compiler_py) " +
238        "--plugin-path=$(location protoc-gen-nanopb) " +
239        "--out-dir=$(genDir) " +
240        "--compile-dir=$${compile_dir} " +
241        "--language nanopb " +
242        "--sources $${proto_files} " +
243        "--no-experimental-proto3-optional " +
244        "--no-experimental-editions " +
245        "--pwpb-no-oneof-callbacks " +
246        "--protoc=$(location aprotoc)",
247    tools: [
248        "aprotoc",
249        "protoc-gen-nanopb",
250        "pw_protobuf_compiler_py",
251    ],
252}
253
254// Same as pw_rpc_generate_nanopb_proto but the proto files are compiled with a
255// single prefix, which can be added with pw_rpc_add_prefix_to_proto.
256// Since pw_rpc_add_prefix_to_proto may include .option files as an input, only
257// .proto files are passed to the compile script. Make sure .option files are
258// prefixed in the same rule as their .proto files. All dependencies must also
259// be listed in srcs and have a single prefix.
260//
261// See the pw_rpc_echo_service_nanopb target for an example. The echo.proto file
262// is compiled with "pw_rpc" as the prefix.
263//
264// Args:
265//   srcs: The list of source files all with one prefix folder.
266//   out: A one-element list with the output file with a prefix folder. The
267//     prefix is based on the parent name of the first item in srcs.
268genrule_defaults {
269    name: "pw_rpc_generate_nanopb_proto_with_prefix",
270    cmd: "in_files=($(in)); prefix_dir=$$(dirname $${in_files[0]}); " +
271        "compile_dir=$$(dirname $${prefix_dir}); " +
272        "proto_files=(); " +
273        "proto_paths_args=\"\"; " +
274        "for f in \"$${in_files[@]}\"; do " +
275        "if [[ \"$${f##*.}\" == \"proto\" ]]; then " +
276        "proto_files+=(\"$${f}\"); " +
277        "proto_path_args+=\"--proto-path=$$(dirname $$(dirname $${f})) \"; " +
278        "fi; done; " +
279        "python3 $(location pw_protobuf_compiler_py) " +
280        "--plugin-path=$(location protoc-gen-nanopb) " +
281        "$${proto_path_args} " +
282        "--out-dir=$(genDir) " +
283        "--compile-dir=$${compile_dir} " +
284        "--language nanopb " +
285        "--sources $${proto_files} " +
286        "--no-experimental-proto3-optional " +
287        "--no-experimental-editions " +
288        "--pwpb-no-oneof-callbacks " +
289        "--protoc=$(location aprotoc)",
290    tools: [
291        "aprotoc",
292        "protoc-gen-nanopb",
293        "pw_protobuf_compiler_py",
294    ],
295}
296
297// Generate the header nanopb RPC file (.rpc.pb.h).
298//
299// Args:
300//   srcs: The list of source files without a prefix.
301//   out: A one-element list with the output file without a prefix. The name is
302//     based on the srcs file name with a .rpc.pb.h extension.
303genrule_defaults {
304    name: "pw_rpc_generate_nanopb_rpc_header",
305    cmd: "in_files=($(in)); compile_dir=$$(dirname $${in_files[0]}); " +
306        "python3 $(location pw_protobuf_compiler_py) " +
307        "--plugin-path=$(location pw_rpc_plugin_nanopb_py) " +
308        "--out-dir=$(genDir) " +
309        "--compile-dir=$${compile_dir} " +
310        "--language nanopb_rpc " +
311        "--sources $(in) " +
312        "--no-experimental-proto3-optional " +
313        "--no-experimental-editions " +
314        "--pwpb-no-oneof-callbacks " +
315        "--protoc=$(location aprotoc)",
316    tools: [
317        "aprotoc",
318        "pw_protobuf_compiler_py",
319        "pw_rpc_plugin_nanopb_py",
320    ],
321}
322
323// Same as pw_rpc_generate_nanopb_rpc_header but the proto files are compiled
324// with a single prefix, which can be added with pw_rpc_add_prefix_to_proto.
325// Since pw_rpc_add_prefix_to_proto may include .option files as an input, only
326// .proto files are passed to the compile script. Make sure .option files are
327// prefixed in the same rule as their .proto files. All dependencies must also
328// be listed in srcs and have a single prefix.
329//
330// See the pw_rpc_echo_service_nanopb target for an example. The echo.proto file
331// is compiled with "pw_rpc" as the prefix.
332//
333// Args:
334//   srcs: The list of source files all with one prefix folder.
335//   out: A one-element list with the output file with a prefix folder. The
336//     prefix is based on the parent name of the first item in srcs.
337genrule_defaults {
338    name: "pw_rpc_generate_nanopb_rpc_header_with_prefix",
339    cmd: "in_files=($(in)); prefix_dir=$$(dirname $${in_files[0]}); " +
340        "compile_dir=$$(dirname $${prefix_dir}); " +
341        "proto_files=(); " +
342        "proto_paths_args=\"\"; " +
343        "for f in \"$${in_files[@]}\"; do " +
344        "if [[ \"$${f##*.}\" == \"proto\" ]]; then " +
345        "proto_files+=(\"$${f}\"); " +
346        "proto_path_args+=\"--proto-path=$$(dirname $$(dirname $${f})) \"; " +
347        "fi; done; " +
348        "python3 $(location pw_protobuf_compiler_py) " +
349        "--plugin-path=$(location pw_rpc_plugin_nanopb_py) " +
350        "$${proto_path_args} " +
351        "--out-dir=$(genDir) " +
352        "--compile-dir=$${compile_dir} " +
353        "--language nanopb_rpc " +
354        "--sources $${proto_files} " +
355        "--no-experimental-proto3-optional " +
356        "--no-experimental-editions " +
357        "--pwpb-no-oneof-callbacks " +
358        "--protoc=$(location aprotoc)",
359    tools: [
360        "aprotoc",
361        "pw_protobuf_compiler_py",
362        "pw_rpc_plugin_nanopb_py",
363    ],
364}
365
366// Generate the header raw RPC file.
367// The output file name is based on the srcs file name with a .raw_rpc.pb.h extension.
368genrule_defaults {
369    name: "pw_rpc_generate_raw_rpc_header",
370    cmd: "in_files=($(in)); compile_dir=$$(dirname $${in_files[0]}); " +
371        "python3 $(location pw_protobuf_compiler_py) " +
372        "--plugin-path=$(location pw_rpc_plugin_rawpb_py) " +
373        "--out-dir=$(genDir) " +
374        "--compile-dir=$${compile_dir} " +
375        "--language raw_rpc " +
376        "--sources $(in) " +
377        "--no-experimental-proto3-optional " +
378        "--no-experimental-editions " +
379        "--pwpb-no-oneof-callbacks " +
380        "--protoc=$(location aprotoc)",
381    tools: [
382        "aprotoc",
383        "pw_protobuf_compiler_py",
384        "pw_rpc_plugin_rawpb_py",
385    ],
386}
387
388// Same as pw_rpc_generate_raw_rpc_header but the proto files are compiled with
389// a single prefix, which can be added with pw_rpc_add_prefix_to_proto.
390// Since pw_rpc_add_prefix_to_proto may include .option files as an input, only
391// .proto files are passed to the compile script. Make sure .option files are
392// prefixed in the same rule as their .proto files.
393//
394// See the pw_rpc_echo_service_pwpb target for an example. The echo.proto file
395// is compiled with "pw_rpc" as the prefix.
396genrule_defaults {
397    name: "pw_rpc_generate_raw_rpc_header_with_prefix",
398    cmd: "in_files=($(in)); prefix_dir=$$(dirname $${in_files[0]}); " +
399        "compile_dir=$$(dirname $${prefix_dir}); proto_files=(); " +
400        "for f in \"$${in_files[@]}\"; do " +
401        "if [[ \"$${f##*.}\" == \"proto\" ]]; then " +
402        "proto_files+=(\"$${f}\"); fi; done; " +
403        "python3 $(location pw_protobuf_compiler_py) " +
404        "--plugin-path=$(location pw_rpc_plugin_rawpb_py) " +
405        "--out-dir=$(genDir) " +
406        "--compile-dir=$${compile_dir} " +
407        "--language raw_rpc " +
408        "--sources $${proto_files} " +
409        "--no-experimental-proto3-optional " +
410        "--no-experimental-editions " +
411        "--pwpb-no-oneof-callbacks " +
412        "--protoc=$(location aprotoc)",
413    tools: [
414        "aprotoc",
415        "pw_protobuf_compiler_py",
416        "pw_rpc_plugin_rawpb_py",
417    ],
418}
419
420// Generate header pwpb files.
421// The output file names are based on the srcs file name with a .pwpb.h extension.
422genrule_defaults {
423    name: "pw_rpc_generate_pwpb_proto",
424    cmd: "in_files=($(in)); compile_dir=$$(dirname $${in_files[0]}); " +
425        "python3 $(location pw_protobuf_compiler_py) " +
426        "--plugin-path=$(location pw_protobuf_plugin_py) " +
427        "--out-dir=$(genDir) " +
428        "--compile-dir=$${compile_dir} " +
429        "--language pwpb " +
430        "--sources $(in) " +
431        "--no-experimental-proto3-optional " +
432        "--no-experimental-editions " +
433        "--pwpb-no-oneof-callbacks " +
434        "--protoc=$(location aprotoc)",
435    tools: [
436        "aprotoc",
437        "pw_protobuf_plugin_py",
438        "pw_protobuf_compiler_py",
439    ],
440}
441
442// Same as pw_rpc_generate_pwpb_proto but the proto files are compiled with a
443// single prefix, which can be added with pw_rpc_add_prefix_to_proto.
444// Since pw_rpc_add_prefix_to_proto may include .option files as an input, only
445// .proto files are passed to the compile script. Make sure .option files are
446// prefixed in the same rule as their .proto files.
447//
448// See the pw_rpc_echo_service_pwpb target for an example. The echo.proto file
449// is compiled with "pw_rpc" as the prefix.
450genrule_defaults {
451    name: "pw_rpc_generate_pwpb_proto_with_prefix",
452    cmd: "in_files=($(in)); prefix_dir=$$(dirname $${in_files[0]}); " +
453        "compile_dir=$$(dirname $${prefix_dir}); proto_files=(); " +
454        "for f in \"$${in_files[@]}\"; do " +
455        "if [[ \"$${f##*.}\" == \"proto\" ]]; then " +
456        "proto_files+=(\"$${f}\"); fi; done; " +
457        "python3 $(location pw_protobuf_compiler_py) " +
458        "--plugin-path=$(location pw_protobuf_plugin_py) " +
459        "--out-dir=$(genDir) " +
460        "--compile-dir=$${compile_dir} " +
461        "--language pwpb " +
462        "--sources $${proto_files} " +
463        "--no-experimental-proto3-optional " +
464        "--no-experimental-editions " +
465        "--pwpb-no-oneof-callbacks " +
466        "--protoc=$(location aprotoc)",
467    tools: [
468        "aprotoc",
469        "pw_protobuf_plugin_py",
470        "pw_protobuf_compiler_py",
471    ],
472}
473
474// Generate the header pwpb RPC file.
475// The output file name is based on the srcs file name with a .rpc.pwpb.h extension.
476genrule_defaults {
477    name: "pw_rpc_generate_pwpb_rpc_header",
478    cmd: "in_files=($(in)); compile_dir=$$(dirname $${in_files[0]}); " +
479        "python3 $(location pw_protobuf_compiler_py) " +
480        "--plugin-path=$(location pw_rpc_plugin_pwpb_py) " +
481        "--out-dir=$(genDir) " +
482        "--compile-dir=$${compile_dir} " +
483        "--language pwpb_rpc " +
484        "--sources $(in) " +
485        "--no-experimental-proto3-optional " +
486        "--no-experimental-editions " +
487        "--pwpb-no-oneof-callbacks " +
488        "--protoc=$(location aprotoc)",
489    tools: [
490        "aprotoc",
491        "pw_protobuf_compiler_py",
492        "pw_rpc_plugin_pwpb_py",
493    ],
494}
495
496// Same as pw_rpc_generate_pwpb_rpc_header but the proto files are compiled
497// with a single prefix, which can be added with pw_rpc_add_prefix_to_proto.
498// Since pw_rpc_add_prefix_to_proto may include .option files as an input, only
499// .proto files are passed to the compile script. Make sure .option files are
500// prefixed in the same rule as their .proto files.
501//
502// See the pw_rpc_echo_service_pwpb target for an example. The echo.proto file
503// is compiled with "pw_rpc" as the prefix.
504genrule_defaults {
505    name: "pw_rpc_generate_pwpb_rpc_header_with_prefix",
506    cmd: "in_files=($(in)); prefix_dir=$$(dirname $${in_files[0]}); " +
507        "compile_dir=$$(dirname $${prefix_dir}); proto_files=(); " +
508        "for f in \"$${in_files[@]}\"; do " +
509        "if [[ \"$${f##*.}\" == \"proto\" ]]; then " +
510        "proto_files+=(\"$${f}\"); fi; done; " +
511        "python3 $(location pw_protobuf_compiler_py) " +
512        "--plugin-path=$(location pw_rpc_plugin_pwpb_py) " +
513        "--out-dir=$(genDir) " +
514        "--compile-dir=$${compile_dir} " +
515        "--language pwpb_rpc " +
516        "--sources $${proto_files} " +
517        "--no-experimental-proto3-optional " +
518        "--no-experimental-editions " +
519        "--pwpb-no-oneof-callbacks " +
520        "--protoc=$(location aprotoc)",
521    tools: [
522        "aprotoc",
523        "pw_protobuf_compiler_py",
524        "pw_rpc_plugin_pwpb_py",
525    ],
526}
527
528// Copies the proto files to a prefix directory to add the prefix to the
529// compiled proto. The prefix is taken from the directory name of the first
530// item listen in out.
531genrule_defaults {
532    name: "pw_rpc_add_prefix_to_proto",
533    cmd: "out_files=($(out)); prefix=$$(dirname $${out_files[0]}); " +
534        "mkdir -p $${prefix}; cp -t $${prefix} $(in);",
535}
536
537genrule {
538    name: "pw_rpc_echo_proto_with_prefix",
539    defaults: ["pw_rpc_add_prefix_to_proto"],
540    srcs: [
541        "echo.options",
542        "echo.proto",
543    ],
544    out: [
545        "pw_rpc/echo.options",
546        "pw_rpc/echo.proto",
547    ],
548}
549
550genrule {
551    name: "pw_rpc_echo_rpc_header",
552    defaults: ["pw_rpc_generate_nanopb_rpc_header_with_prefix"],
553    srcs: [":pw_rpc_echo_proto_with_prefix"],
554    out: ["pw_rpc/echo.rpc.pb.h"],
555}
556
557genrule {
558    name: "pw_rpc_echo_proto_header",
559    defaults: ["pw_rpc_generate_nanopb_proto_with_prefix"],
560    srcs: [":pw_rpc_echo_proto_with_prefix"],
561    out: ["pw_rpc/echo.pb.h"],
562}
563
564genrule {
565    name: "pw_rpc_echo_proto_source",
566    defaults: ["pw_rpc_generate_nanopb_proto_with_prefix"],
567    srcs: [":pw_rpc_echo_proto_with_prefix"],
568    out: ["pw_rpc/echo.pb.c"],
569}
570
571// This is a copy of the echo.pb.h header, since the generated echo.pb.c
572// includes it by file name, while pw_rpc/nanopb/echo_service_nanopb.h includes
573// it with a prefix.
574// Soong makes it very hard to add include directories when they don't come from
575// modules, so this is a kludge to add an include directory path without a
576// prefix.
577genrule {
578    name: "pw_rpc_echo_proto_header_copy",
579    cmd: "cp $(in) $(out)",
580    srcs: [":pw_rpc_echo_proto_header"],
581    out: ["echo.pb.h"],
582}
583
584cc_library_static {
585    name: "pw_rpc_echo_service_nanopb",
586    cpp_std: "c++20",
587    vendor_available: true,
588    host_supported: true,
589    export_include_dirs: ["public/pw_rpc"],
590    generated_headers: [
591        "pw_rpc_echo_proto_header",
592        "pw_rpc_echo_proto_header_copy",
593        "pw_rpc_echo_rpc_header",
594    ],
595    export_generated_headers: [
596        "pw_rpc_echo_proto_header",
597        "pw_rpc_echo_proto_header_copy",
598        "pw_rpc_echo_rpc_header",
599    ],
600    generated_sources: ["pw_rpc_echo_proto_source"],
601    static_libs: ["libprotobuf-c-nano"],
602}
603
604genrule {
605    name: "pw_rpc_echo_pwpb_rpc_header",
606    defaults: ["pw_rpc_generate_pwpb_rpc_header_with_prefix"],
607    srcs: [":pw_rpc_echo_proto_with_prefix"],
608    out: ["pw_rpc/echo.rpc.pwpb.h"],
609}
610
611genrule {
612    name: "pw_rpc_echo_pwpb_proto_header",
613    defaults: ["pw_rpc_generate_pwpb_proto_with_prefix"],
614    srcs: [":pw_rpc_echo_proto_with_prefix"],
615    out: ["pw_rpc/echo.pwpb.h"],
616}
617
618cc_library_static {
619    name: "pw_rpc_echo_service_pwpb",
620    cpp_std: "c++20",
621    vendor_available: true,
622    host_supported: true,
623    export_include_dirs: ["public/pw_rpc"],
624    generated_headers: [
625        "pw_rpc_echo_pwpb_proto_header",
626        "pw_rpc_echo_pwpb_rpc_header",
627    ],
628    export_generated_headers: [
629        "pw_rpc_echo_pwpb_proto_header",
630        "pw_rpc_echo_pwpb_rpc_header",
631    ],
632}
633
634python_library_host {
635    name: "pw_rpc_internal_packet_py_lib",
636    srcs: [
637        ":pw_rpc_internal_packet_py",
638    ],
639    pkg_path: "pw_rpc/internal",
640}
641