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 15include($ENV{PW_ROOT}/pw_build/pigweed.cmake) 16include($ENV{PW_ROOT}/pw_async2/backend.cmake) 17 18pw_add_library(pw_channel INTERFACE 19 HEADERS 20 public/pw_channel/channel.h 21 PUBLIC_DEPS 22 pw_assert 23 pw_async2.dispatcher 24 pw_async2.poll 25 pw_bytes 26 pw_multibuf 27 pw_multibuf.allocator 28 pw_result 29 pw_span 30 pw_status 31 pw_toolchain._sibling_cast 32 PUBLIC_INCLUDES 33 public 34) 35 36pw_add_test(pw_channel.channel_test 37 SOURCES 38 channel_test.cc 39 PRIVATE_DEPS 40 pw_channel 41 pw_allocator.testing 42 pw_compilation_testing._pigweed_only_negative_compilation 43 pw_preprocessor 44 pw_multibuf.simple_allocator 45) 46 47pw_add_library(pw_channel.forwarding_channel STATIC 48 HEADERS 49 public/pw_channel/forwarding_channel.h 50 SOURCES 51 forwarding_channel.cc 52 PUBLIC_DEPS 53 pw_channel 54 pw_multibuf.allocator 55 pw_sync.mutex 56 PUBLIC_INCLUDES 57 public 58) 59 60pw_add_test(pw_channel.forwarding_channel_test 61 SOURCES 62 forwarding_channel_test.cc 63 PRIVATE_DEPS 64 pw_allocator.testing 65 pw_channel.forwarding_channel 66 pw_multibuf.header_chunk_region_tracker 67 pw_multibuf.simple_allocator 68) 69 70pw_add_library(pw_channel.loopback_channel STATIC 71 HEADERS 72 public/pw_channel/loopback_channel.h 73 SOURCES 74 loopback_channel.cc 75 PUBLIC_DEPS 76 pw_channel 77 pw_multibuf.allocator 78 PUBLIC_INCLUDES 79 public 80) 81 82pw_add_test(pw_channel.loopback_channel_test 83 SOURCES 84 loopback_channel_test.cc 85 PRIVATE_DEPS 86 pw_channel.loopback_channel 87 pw_multibuf.testing 88) 89 90pw_add_library(pw_channel.epoll_channel STATIC 91 HEADERS 92 public/pw_channel/epoll_channel.h 93 SOURCES 94 epoll_channel.cc 95 PUBLIC_DEPS 96 pw_channel 97 pw_multibuf.allocator 98 PUBLIC_INCLUDES 99 public 100) 101 102pw_add_test(pw_channel.epoll_channel_test 103 SOURCES 104 epoll_channel_test.cc 105 PRIVATE_DEPS 106 pw_channel.epoll_channel 107 pw_multibuf.testing 108 pw_thread.sleep 109 pw_thread.thread 110) 111