blob: 0a16c572213803634a6c9d3f6e2f6a9839f4ee67 [file] [log] [blame]
Carlos Chinchillae8275d32021-12-08 09:46:35 -08001# 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
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080015load(
16 "//pw_build:pigweed.bzl",
Armando Montanez2c042f92021-12-15 14:55:36 -080017 "pw_cc_binary",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080018 "pw_cc_library",
19)
20
Carlos Chinchillae8275d32021-12-08 09:46:35 -080021package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"])
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080024
Armando Montanezce59a872022-03-16 11:14:28 -070025# WARNING: Many of the dependencies in this file are missing and need to be
26# added/updated. This is provided as a starting point, but currently does not
27# work.
28
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080029pw_cc_library(
30 name = "config",
31 hdrs = [
32 "public/pw_system/config.h",
33 ],
34)
35
36pw_cc_library(
37 name = "log",
38 srcs = [
39 "log.cc",
40 ],
41 hdrs = [
42 "pw_system_private/log.h",
43 ],
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080044 deps = [
Ewout van Bekkum5ddc01d2022-03-08 12:50:25 -080045 ":config",
Armando Montanezce59a872022-03-16 11:14:28 -070046 ":rpc_server",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080047 "//pw_log_rpc:log_service",
48 "//pw_log_rpc:rpc_log_drain",
49 "//pw_log_rpc:rpc_log_drain_thread",
Ewout van Bekkum5ddc01d2022-03-08 12:50:25 -080050 "//pw_multisink",
51 "//pw_sync:lock_annotations",
52 "//pw_sync:mutex",
53 ],
54)
55
56pw_cc_library(
57 name = "log_backend",
58 srcs = [
59 "log_backend.cc",
60 ],
61 deps = [
62 ":config",
63 ":log",
64 "//pw_bytes",
65 "//pw_chrono:system_clock",
66 "//pw_log:facade",
67 "//pw_log:proto_utils",
68 "//pw_log_string:handler_facade",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080069 "//pw_log_tokenized:metadata",
70 "//pw_multisink",
71 "//pw_result",
Ewout van Bekkum5ddc01d2022-03-08 12:50:25 -080072 "//pw_string",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080073 "//pw_sync:interrupt_spin_lock",
74 "//pw_sync:lock_annotations",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080075 "//pw_tokenizer",
76 ],
77)
78
79pw_cc_library(
Armando Montanezce59a872022-03-16 11:14:28 -070080 name = "rpc_server",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080081 hdrs = [
Armando Montanezce59a872022-03-16 11:14:28 -070082 "public/pw_system/rpc_server.h",
83 ],
84 includes = ["public"],
85 deps = [
86 ":config",
87 ":hdlc_rpc_server",
88 ],
89)
90
91pw_cc_library(
92 name = "hdlc_rpc_server",
93 srcs = [
94 "hdlc_rpc_server.cc",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -080095 ],
96 includes = ["public"],
97 deps = [
98 ":io",
Armando Montanezce59a872022-03-16 11:14:28 -070099 ":rpc_server",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -0800100 ":target_io",
101 "//pw_assert",
102 "//pw_hdlc:pw_rpc",
103 "//pw_hdlc:rpc_channel_output",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -0800104 "//pw_sync:mutex",
105 "//pw_thread:thread_core",
106 ],
107)
108
109pw_cc_library(
110 name = "io",
111 hdrs = [
112 "public/pw_system/io.h",
113 ],
114 deps = [
115 "//pw_stream",
116 ],
117)
118
119pw_cc_library(
120 name = "init",
121 srcs = [
122 "init.cc",
123 ],
124 hdrs = [
125 "public/pw_system/init.h",
126 ],
127 includes = ["public"],
128 deps = [
129 ":log",
Armando Montanezce59a872022-03-16 11:14:28 -0700130 ":rpc_server",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -0800131 "//pw_rpc/nanopb:echo_service",
132 "//pw_thread:thread",
133 ],
134)
135
Armando Montanez2c042f92021-12-15 14:55:36 -0800136pw_cc_library(
137 name = "work_queue",
138 srcs = [
139 "work_queue.cc",
140 ],
141 hdrs = [
142 "public/pw_system/work_queue.h",
143 ],
144 includes = ["public"],
145 deps = [
146 "//pw_work_queue",
147 ],
148)
149
Carlos Chinchillaecf3d802021-12-08 12:35:54 -0800150pw_cc_library(
151 name = "target_io",
152 srcs = [
153 "target_io.cc",
154 ],
155 includes = ["public"],
156 deps = [
157 ":io",
158 "//pw_stream",
159 "//pw_stream:sys_io_stream",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -0800160 ],
161)
162
Carlos Chinchillaecf3d802021-12-08 12:35:54 -0800163pw_cc_library(
Armando Montanez42f2b4d2022-01-06 13:19:47 -0800164 name = "socket_target_io",
165 srcs = [
166 "socket_target_io.cc",
167 ],
168 includes = ["public"],
169 deps = [
170 ":config",
171 ":io",
172 "//pw_assert",
173 "//pw_stream",
174 "//pw_stream:socket_stream",
175 ],
176)
177
178pw_cc_library(
Armando Montanez2c042f92021-12-15 14:55:36 -0800179 name = "target_hooks",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -0800180 hdrs = [
Armando Montanez2c042f92021-12-15 14:55:36 -0800181 "public/pw_system/target_hooks.h",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -0800182 ],
183 includes = ["public"],
184 deps = [
Armando Montanez2c042f92021-12-15 14:55:36 -0800185 "//pw_thread:thread",
186 ],
187)
188
189pw_cc_library(
190 name = "stl_target_hooks",
191 srcs = [
192 "stl_target_hooks.cc",
193 ],
194 deps = [
195 "//pw_thread:sleep",
196 "//pw_thread:thread",
197 "//pw_thread_stl:thread",
198 ],
199)
200
201pw_cc_library(
202 name = "freertos_target_hooks",
203 srcs = [
204 "freertos_target_hooks.cc",
205 ],
206
207 # TODO(pwbug/317): This should depend on FreeRTOS but our third parties
208 # currently do not have Bazel support.
209 deps = [
210 "//pw_thread:thread",
Carlos Chinchillaecf3d802021-12-08 12:35:54 -0800211 "//pw_thread_freertos:thread",
212 ],
213)
Armando Montanez2c042f92021-12-15 14:55:36 -0800214
215pw_cc_binary(
216 name = "system_example",
217 srcs = ["example_user_app_init.cc"],
218 deps = [
219 ":init",
220 ":io",
221 ":target_hooks",
222 "//pw_stream",
223 "//pw_stream:sys_io_stream",
224 ],
225)