1 # Copyright 2021 The Pigweed Authors
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
7 # https://www.apache.org/licenses/LICENSE-2.0
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
15 import("//build_overrides/pigweed.gni")
17 import("$dir_pw_build/python.gni")
18 import("$dir_pw_build/target_types.gni")
19 import("$dir_pw_docgen/docs.gni")
20 import("$dir_pw_unit_test/test.gni")
22 config("default_config") {
23 include_dirs = [ "public" ]
33 pw_source_set("decoder") {
34 public_configs = [ ":default_config" ]
35 public = [ "public/pw_hdlc/decoder.h" ]
38 "pw_hdlc_private/protocol.h",
50 pw_source_set("encoder") {
51 public_configs = [ ":default_config" ]
52 public = [ "public/pw_hdlc/encoder.h" ]
55 "public/pw_hdlc/internal/encoder.h",
56 "pw_hdlc_private/protocol.h",
59 "$dir_pw_stream:sys_io_stream",
69 pw_source_set("rpc_channel_output") {
70 public_configs = [ ":default_config" ]
71 public = [ "public/pw_hdlc/rpc_channel.h" ]
78 pw_source_set("pw_rpc") {
79 public_configs = [ ":default_config" ]
80 public = [ "public/pw_hdlc/rpc_packets.h" ]
81 sources = [ "rpc_packets.cc" ]
88 pw_source_set("packet_parser") {
89 public_configs = [ ":default_config" ]
90 public = [ "public/pw_hdlc/wire_packet_parser.h" ]
91 sources = [ "wire_packet_parser.cc" ]
94 "$dir_pw_router:packet_parser",
103 pw_test_group("tests") {
108 ":wire_packet_parser_test",
111 "$dir_pw_preprocessor:tests",
112 "$dir_pw_status:tests",
113 "$dir_pw_stream:tests",
117 pw_test("encoder_test") {
118 deps = [ ":pw_hdlc" ]
119 sources = [ "encoder_test.cc" ]
122 pw_python_action("generate_decoder_test") {
123 outputs = [ "$target_gen_dir/generated_decoder_test.cc" ]
124 script = "py/decode_test.py"
125 args = [ "--generate-cc-test" ] + rebase_path(outputs)
132 pw_test("decoder_test") {
134 ":generate_decoder_test",
137 sources = [ "decoder_test.cc" ] + get_target_outputs(":generate_decoder_test")
140 pw_test("rpc_channel_test") {
143 ":rpc_channel_output",
145 sources = [ "rpc_channel_test.cc" ]
148 pw_test("wire_packet_parser_test") {
153 sources = [ "wire_packet_parser_test.cc" ]
156 pw_doc_group("docs") {
159 "rpc_example/docs.rst",
162 "py/pw_hdlc/decode.py",
163 "py/pw_hdlc/encode.py",