1# Copyright 2021 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 15import("//build_overrides/pigweed.gni") 16 17import("$dir_pw_bloat/bloat.gni") 18import("$dir_pw_build/target_types.gni") 19import("$dir_pw_docgen/docs.gni") 20import("$dir_pw_unit_test/test.gni") 21 22config("public_include_path") { 23 include_dirs = [ "public" ] 24 visibility = [ ":*" ] 25} 26 27pw_source_set("static_router") { 28 public_configs = [ ":public_include_path" ] 29 public_deps = [ 30 ":egress", 31 ":packet_parser", 32 dir_pw_metric, 33 dir_pw_span, 34 ] 35 public = [ "public/pw_router/static_router.h" ] 36 sources = [ "static_router.cc" ] 37} 38 39pw_source_set("egress") { 40 public_configs = [ ":public_include_path" ] 41 public = [ "public/pw_router/egress.h" ] 42 public_deps = [ 43 ":packet_parser", 44 dir_pw_bytes, 45 dir_pw_span, 46 ] 47} 48 49pw_source_set("packet_parser") { 50 public_configs = [ ":public_include_path" ] 51 public = [ "public/pw_router/packet_parser.h" ] 52 public_deps = [ 53 dir_pw_bytes, 54 dir_pw_span, 55 ] 56} 57 58pw_source_set("egress_function") { 59 public_configs = [ ":public_include_path" ] 60 public = [ "public/pw_router/egress_function.h" ] 61 public_deps = [ 62 ":egress", 63 dir_pw_function, 64 dir_pw_span, 65 ] 66} 67 68pw_doc_group("docs") { 69 inputs = [ "Kconfig" ] 70 sources = [ "docs.rst" ] 71 report_deps = [ ":static_router_size" ] 72} 73 74pw_test_group("tests") { 75 tests = [ ":static_router_test" ] 76} 77 78pw_test("static_router_test") { 79 deps = [ 80 ":egress_function", 81 ":static_router", 82 ] 83 sources = [ "static_router_test.cc" ] 84} 85 86pw_size_diff("static_router_size") { 87 title = "pw::router::StaticRouter size report" 88 binaries = [ 89 { 90 target = "size_report:static_router_with_one_route" 91 base = "size_report:base" 92 label = "Static router with a single route" 93 }, 94 ] 95} 96