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 15include($ENV{PW_ROOT}/pw_build/pigweed.cmake) 16 17pw_add_library(pw_router.static_router STATIC 18 HEADERS 19 public/pw_router/static_router.h 20 PUBLIC_INCLUDES 21 public 22 PUBLIC_DEPS 23 pw_metric 24 pw_router.egress 25 pw_router.packet_parser 26 pw_span 27 SOURCES 28 static_router.cc 29 PRIVATE_DEPS 30 pw_log 31) 32if(Zephyr_FOUND AND CONFIG_PIGWEED_ROUTER_STATIC_ROUTER) 33 zephyr_link_libraries(pw_router.static_router) 34endif() 35 36pw_add_library(pw_router.egress INTERFACE 37 HEADERS 38 public/pw_router/egress.h 39 PUBLIC_INCLUDES 40 public 41 PUBLIC_DEPS 42 pw_bytes 43 pw_router.packet_parser 44 pw_span 45) 46if(Zephyr_FOUND AND CONFIG_PIGWEED_ROUTER_EGRESS) 47 zephyr_link_libraries(pw_router.egress) 48endif() 49 50pw_add_library(pw_router.packet_parser INTERFACE 51 HEADERS 52 public/pw_router/packet_parser.h 53 PUBLIC_INCLUDES 54 public 55 PUBLIC_DEPS 56 pw_bytes 57 pw_span 58) 59if(Zephyr_FOUND AND CONFIG_PIGWEED_ROUTER_PACKET_PARSER) 60 zephyr_link_libraries(pw_router.packet_parser) 61endif() 62 63pw_add_library(pw_router.egress_function INTERFACE 64 HEADERS 65 public/pw_router/egress_function.h 66 PUBLIC_INCLUDES 67 public 68 PUBLIC_DEPS 69 pw_function 70 pw_router.egress 71 pw_span 72) 73if(Zephyr_FOUND AND CONFIG_PIGWEED_ROUTER_EGRESS_FUNCTION) 74 zephyr_link_libraries(pw_router.egress_function) 75endif() 76 77pw_add_test(pw_router.static_router_test 78 SOURCES 79 static_router_test.cc 80 PRIVATE_DEPS 81 pw_router.egress_function 82 pw_router.static_router 83 GROUPS 84 modules 85 pw_router 86) 87