xref: /aosp_15_r20/external/pigweed/pw_channel/CMakeLists.txt (revision 61c4878ac05f98d0ceed94b57d316916de578985)
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 STATIC
19  HEADERS
20    public/pw_channel/channel.h
21    public/pw_channel/properties.h
22  PUBLIC_DEPS
23    pw_assert
24    pw_async2.dispatcher
25    pw_async2.poll
26    pw_bytes
27    pw_multibuf
28    pw_multibuf.allocator
29    pw_result
30    pw_span
31    pw_status
32    pw_toolchain._sibling_cast
33  PUBLIC_INCLUDES
34    public
35  SOURCES
36    public/pw_channel/internal/channel_specializations.h
37)
38
39pw_add_test(pw_channel.channel_test
40  SOURCES
41    channel_test.cc
42  PRIVATE_DEPS
43    pw_channel
44    pw_allocator.testing
45    pw_compilation_testing._pigweed_only_negative_compilation
46    pw_preprocessor
47    pw_multibuf.simple_allocator
48)
49
50pw_add_library(pw_channel.forwarding_channel STATIC
51  HEADERS
52    public/pw_channel/forwarding_channel.h
53  SOURCES
54    forwarding_channel.cc
55  PUBLIC_DEPS
56    pw_channel
57    pw_multibuf.allocator
58    pw_sync.mutex
59  PUBLIC_INCLUDES
60    public
61)
62
63pw_add_test(pw_channel.forwarding_channel_test
64  SOURCES
65    forwarding_channel_test.cc
66  PRIVATE_DEPS
67    pw_allocator.testing
68    pw_channel.forwarding_channel
69    pw_multibuf.header_chunk_region_tracker
70    pw_multibuf.simple_allocator
71)
72
73pw_add_library(pw_channel.loopback_channel STATIC
74  HEADERS
75    public/pw_channel/loopback_channel.h
76  SOURCES
77    loopback_channel.cc
78  PUBLIC_DEPS
79    pw_channel
80    pw_multibuf.allocator
81  PUBLIC_INCLUDES
82    public
83)
84
85pw_add_test(pw_channel.loopback_channel_test
86  SOURCES
87    loopback_channel_test.cc
88  PRIVATE_DEPS
89    pw_channel.loopback_channel
90    pw_multibuf.testing
91)
92
93pw_add_library(pw_channel.epoll_channel STATIC
94  HEADERS
95    public/pw_channel/epoll_channel.h
96  SOURCES
97    epoll_channel.cc
98  PUBLIC_DEPS
99    pw_channel
100    pw_multibuf.allocator
101    pw_sync.mutex
102  PUBLIC_INCLUDES
103    public
104  PRIVATE_DEPS
105    pw_log
106)
107
108pw_add_test(pw_channel.epoll_channel_test
109  SOURCES
110    epoll_channel_test.cc
111  PRIVATE_DEPS
112    pw_channel.epoll_channel
113    pw_multibuf.testing
114    pw_thread.sleep
115    pw_thread.thread
116)
117
118pw_add_library(pw_channel.stream_channel STATIC
119  HEADERS
120    public/pw_channel/stream_channel.h
121  SOURCES
122    stream_channel.cc
123  PUBLIC_DEPS
124    pw_channel
125    pw_log
126    pw_stream
127    pw_sync.interrupt_spin_lock
128    pw_sync.thread_notification
129    pw_thread.thread
130  PUBLIC_INCLUDES
131    public
132)
133
134pw_add_test(pw_channel.stream_channel_test
135  SOURCES
136    stream_channel_test.cc
137  PRIVATE_DEPS
138    pw_channel.stream_channel
139    pw_async2.pend_func_task
140    pw_multibuf.testing
141    pw_stream
142    pw_stream.mpsc_stream
143    pw_thread.thread
144    pw_thread.test_thread_context
145)
146