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_bloat/bloat.gni")
18 import("$dir_pw_build/target_types.gni")
19 import("$dir_pw_docgen/docs.gni")
20 import("$dir_pw_sync/backend.gni")
21 import("$dir_pw_unit_test/test.gni")
23 config("public_include_path") {
24 include_dirs = [ "public" ]
28 pw_source_set("static_router") {
29 public_configs = [ ":public_include_path" ]
36 public = [ "public/pw_router/static_router.h" ]
37 sources = [ "static_router.cc" ]
41 pw_source_set("egress") {
42 public_configs = [ ":public_include_path" ]
43 public = [ "public/pw_router/egress.h" ]
44 public_deps = [ dir_pw_bytes ]
47 pw_source_set("packet_parser") {
48 public_configs = [ ":public_include_path" ]
49 public = [ "public/pw_router/packet_parser.h" ]
50 public_deps = [ dir_pw_bytes ]
53 pw_source_set("egress_function") {
54 public_configs = [ ":public_include_path" ]
55 public = [ "public/pw_router/egress_function.h" ]
56 public_deps = [ ":egress" ]
59 pw_doc_group("docs") {
60 sources = [ "docs.rst" ]
61 # TODO(frolv): This size report can't currently be built as the docs target
62 # does not have a mutex backend.
63 # report_deps = [ ":static_router_size" ]
66 pw_test_group("tests") {
67 tests = [ ":static_router_test" ]
70 pw_test("static_router_test") {
75 sources = [ "static_router_test.cc" ]
76 enable_if = pw_sync_MUTEX_BACKEND != ""
79 pw_size_report("static_router_size") {
80 title = "pw::router::StaticRouter size report"
83 target = "size_report:static_router_with_one_route"
84 base = "size_report:base"
85 label = "Static router with a single route"