1# Copyright 2024 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 15load( 16 "//pw_build:pigweed.bzl", 17 "pw_cc_test", 18) 19 20package(default_visibility = ["//visibility:public"]) 21 22licenses(["notice"]) 23 24cc_library( 25 name = "pw_channel", 26 srcs = ["public/pw_channel/internal/channel_specializations.h"], 27 hdrs = ["public/pw_channel/channel.h"], 28 includes = ["public"], 29 deps = [ 30 "//pw_assert", 31 "//pw_async2:dispatcher", 32 "//pw_async2:poll", 33 "//pw_bytes", 34 "//pw_multibuf", 35 "//pw_multibuf:allocator", 36 "//pw_result", 37 "//pw_span", 38 "//pw_status", 39 "//pw_toolchain:sibling_cast", 40 ], 41) 42 43pw_cc_test( 44 name = "channel_test", 45 srcs = ["channel_test.cc"], 46 deps = [ 47 ":pw_channel", 48 "//pw_allocator:testing", 49 "//pw_compilation_testing:negative_compilation_testing", 50 "//pw_multibuf:simple_allocator", 51 "//pw_preprocessor", 52 "//pw_unit_test", 53 ], 54) 55 56cc_library( 57 name = "forwarding_channel", 58 srcs = ["forwarding_channel.cc"], 59 hdrs = ["public/pw_channel/forwarding_channel.h"], 60 includes = ["public"], 61 deps = [ 62 ":pw_channel", 63 "//pw_multibuf:allocator", 64 "//pw_sync:mutex", 65 ], 66) 67 68pw_cc_test( 69 name = "forwarding_channel_test", 70 srcs = ["forwarding_channel_test.cc"], 71 deps = [ 72 ":forwarding_channel", 73 "//pw_allocator:testing", 74 "//pw_multibuf:header_chunk_region_tracker", 75 "//pw_multibuf:simple_allocator", 76 "//pw_unit_test", 77 ], 78) 79 80cc_library( 81 name = "loopback_channel", 82 srcs = ["loopback_channel.cc"], 83 hdrs = ["public/pw_channel/loopback_channel.h"], 84 includes = ["public"], 85 deps = [ 86 ":pw_channel", 87 "//pw_multibuf:allocator", 88 ], 89) 90 91pw_cc_test( 92 name = "loopback_channel_test", 93 srcs = ["loopback_channel_test.cc"], 94 deps = [ 95 ":loopback_channel", 96 "//pw_multibuf:testing", 97 "//pw_unit_test", 98 ], 99) 100 101cc_library( 102 name = "epoll_channel", 103 srcs = ["epoll_channel.cc"], 104 hdrs = ["public/pw_channel/epoll_channel.h"], 105 includes = ["public"], 106 target_compatible_with = ["@platforms//os:linux"], 107 deps = [ 108 ":pw_channel", 109 "@pigweed//pw_multibuf:allocator", 110 ], 111) 112 113pw_cc_test( 114 name = "epoll_channel_test", 115 srcs = ["epoll_channel_test.cc"], 116 target_compatible_with = ["@platforms//os:linux"], 117 deps = [ 118 ":epoll_channel", 119 "@pigweed//pw_multibuf:testing", 120 "@pigweed//pw_thread:sleep", 121 "@pigweed//pw_thread:thread", 122 "@pigweed//pw_unit_test", 123 ], 124) 125