blob: d91540441c6598717b861f1a031f591bf36ca6aa [file] [log] [blame]
Alex Perryb3b50792020-01-18 16:13:45 -08001load("//aos/seasocks:gen_embedded.bzl", "gen_embedded")
2load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_ts_library")
Austin Schuhe84c3ed2019-12-14 15:29:48 -08003load("//aos:config.bzl", "aos_config")
4
Brian Silverman7a7c24d2018-09-01 17:49:09 -07005package(default_visibility = ["//visibility:public"])
Brian Silverman100534c2015-09-07 15:51:23 -04006
Austin Schuhe84c3ed2019-12-14 15:29:48 -08007flatbuffer_cc_library(
8 name = "connect_fbs",
9 srcs = ["connect.fbs"],
10 gen_reflections = 1,
11 includes = [
12 "//aos:configuration_fbs_includes",
13 ],
14)
15
16flatbuffer_cc_library(
17 name = "message_bridge_client_fbs",
18 srcs = ["message_bridge_client.fbs"],
19 gen_reflections = 1,
20 includes = [
21 ":message_bridge_server_fbs_includes",
22 "//aos:configuration_fbs_includes",
23 ],
24)
25
26flatbuffer_cc_library(
27 name = "message_bridge_server_fbs",
28 srcs = ["message_bridge_server.fbs"],
29 gen_reflections = 1,
30 includes = [
31 "//aos:configuration_fbs_includes",
32 ],
33)
34
Brian Silverman100534c2015-09-07 15:51:23 -040035cc_library(
Brian Silverman7a7c24d2018-09-01 17:49:09 -070036 name = "team_number",
37 srcs = [
38 "team_number.cc",
39 ],
40 hdrs = [
41 "team_number.h",
42 ],
Brian Silverman7a7c24d2018-09-01 17:49:09 -070043 deps = [
John Park33858a32018-09-28 23:05:48 -070044 "//aos/util:string_to_num",
Brian Silverman3dfbfb12020-02-17 20:35:18 -080045 "@com_github_google_glog//:glog",
Brian Silverman7a7c24d2018-09-01 17:49:09 -070046 ],
Brian Silverman100534c2015-09-07 15:51:23 -040047)
48
Austin Schuhdf5591e2015-12-19 22:36:50 -080049cc_test(
Brian Silverman7a7c24d2018-09-01 17:49:09 -070050 name = "team_number_test",
51 srcs = [
52 "team_number_test.cc",
53 ],
54 deps = [
55 ":team_number",
56 "//aos/testing:googletest",
57 ],
Austin Schuhdf5591e2015-12-19 22:36:50 -080058)
Austin Schuhe84c3ed2019-12-14 15:29:48 -080059
60cc_library(
61 name = "sctp_lib",
62 srcs = [
63 "sctp_lib.cc",
64 ],
65 hdrs = [
66 "sctp_lib.h",
67 ],
68 copts = [
69 # The casts required to read datastructures from sockets trip -Wcast-align.
70 "-Wno-cast-align",
71 ],
72 deps = [
73 "//aos:unique_malloc_ptr",
74 "//third_party/lksctp-tools:sctp",
75 "@com_github_google_glog//:glog",
76 ],
77)
78
79cc_library(
80 name = "sctp_server",
81 srcs = [
82 "sctp_server.cc",
83 ],
84 hdrs = [
85 "sctp_server.h",
86 ],
87 copts = [
88 "-Wno-cast-align",
89 ],
90 deps = [
91 ":sctp_lib",
92 "//third_party/lksctp-tools:sctp",
93 ],
94)
95
96cc_library(
97 name = "message_bridge_protocol",
98 hdrs = [
99 "message_bridge_protocol.h",
100 ],
101)
102
103cc_library(
104 name = "message_bridge_server_lib",
105 srcs = [
106 "message_bridge_server_lib.cc",
107 ],
108 hdrs = [
109 "message_bridge_server_lib.h",
110 ],
111 copts = [
112 "-Wno-cast-align",
113 ],
114 deps = [
115 ":connect_fbs",
116 ":message_bridge_protocol",
117 ":message_bridge_server_fbs",
118 ":sctp_lib",
119 ":sctp_server",
120 "//aos:unique_malloc_ptr",
121 "//aos/events:shm_event_loop",
122 "//aos/events/logging:logger",
123 "//third_party/lksctp-tools:sctp",
124 ],
125)
126
127cc_binary(
128 name = "message_bridge_server",
129 srcs = [
130 "message_bridge_server.cc",
131 ],
132 deps = [
133 ":message_bridge_server_lib",
134 "//aos:init",
135 "//aos:json_to_flatbuffer",
136 "//aos/events:shm_event_loop",
137 ],
138)
139
140cc_library(
141 name = "sctp_client",
142 srcs = [
143 "sctp_client.cc",
144 ],
145 hdrs = [
146 "sctp_client.h",
147 ],
148 copts = [
149 "-Wno-cast-align",
150 ],
151 deps = [
152 ":sctp_lib",
153 "//third_party/lksctp-tools:sctp",
154 ],
155)
156
157cc_library(
158 name = "message_bridge_client_lib",
159 srcs = [
160 "message_bridge_client_lib.cc",
161 ],
162 hdrs = [
163 "message_bridge_client_lib.h",
164 ],
165 copts = [
166 "-Wno-cast-align",
167 ],
168 deps = [
169 ":connect_fbs",
170 ":message_bridge_client_fbs",
171 ":message_bridge_protocol",
172 ":message_bridge_server_fbs",
173 ":sctp_client",
174 "//aos/events:shm_event_loop",
175 "//aos/events/logging:logger",
176 ],
177)
178
179cc_binary(
180 name = "message_bridge_client",
181 srcs = [
182 "message_bridge_client.cc",
183 ],
184 copts = [
185 "-Wno-cast-align",
186 ],
187 deps = [
188 ":message_bridge_client_lib",
189 "//aos:init",
190 "//aos:json_to_flatbuffer",
191 "//aos/events:shm_event_loop",
192 ],
193)
194
195aos_config(
196 name = "message_bridge_test_common_config",
197 src = "message_bridge_test_common.json",
198 flatbuffers = [
199 "//aos/events:ping_fbs",
200 "//aos/events:pong_fbs",
201 "//aos/network:message_bridge_client_fbs",
202 "//aos/network:message_bridge_server_fbs",
203 ],
204 deps = ["//aos/events:config"],
205)
206
207aos_config(
208 name = "message_bridge_test_server_config",
209 src = "message_bridge_test_server.json",
210 deps = [":message_bridge_test_common_config"],
211)
212
213aos_config(
214 name = "message_bridge_test_client_config",
215 src = "message_bridge_test_client.json",
216 deps = [":message_bridge_test_common_config"],
217)
218
219cc_test(
220 name = "message_bridge_test",
221 srcs = [
222 "message_bridge_test.cc",
223 ],
224 data = [
225 ":message_bridge_test_client_config.json",
226 ":message_bridge_test_server_config.json",
227 ],
228 deps = [
229 ":message_bridge_client_lib",
230 ":message_bridge_server_lib",
231 "//aos:json_to_flatbuffer",
232 "//aos/events:ping_fbs",
233 "//aos/events:pong_fbs",
234 "//aos/events:shm_event_loop",
235 "//aos/testing:googletest",
236 ],
237)
Alex Perryb3b50792020-01-18 16:13:45 -0800238
239flatbuffer_cc_library(
240 name = "web_proxy_fbs",
241 srcs = ["web_proxy.fbs"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800242 gen_reflections = True,
Alex Perry5f474f22020-02-01 12:14:24 -0800243 includes = [
244 ":connect_fbs_includes",
245 "//aos:configuration_fbs_includes",
246 ],
Alex Perryb3b50792020-01-18 16:13:45 -0800247)
248
249flatbuffer_ts_library(
250 name = "web_proxy_ts_fbs",
251 srcs = ["web_proxy.fbs"],
Alex Perry5f474f22020-02-01 12:14:24 -0800252 includes = [
253 ":connect_fbs_includes",
254 "//aos:configuration_fbs_includes",
255 ],
256)
257
258cc_library(
259 name = "web_proxy_utils",
Alex Perry5f474f22020-02-01 12:14:24 -0800260 srcs = ["web_proxy_utils.cc"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800261 hdrs = ["web_proxy_utils.h"],
Alex Perry5f474f22020-02-01 12:14:24 -0800262 deps = [
263 ":connect_fbs",
264 ":web_proxy_fbs",
265 "//aos:configuration_fbs",
266 "//aos/events:event_loop",
267 "@com_github_google_flatbuffers//:flatbuffers",
268 ],
Alex Perryb3b50792020-01-18 16:13:45 -0800269)
270
271cc_library(
272 name = "web_proxy",
Alex Perryb3b50792020-01-18 16:13:45 -0800273 srcs = ["web_proxy.cc"],
Austin Schuh8bd96322020-02-13 21:18:22 -0800274 hdrs = ["web_proxy.h"],
Alex Perryb3b50792020-01-18 16:13:45 -0800275 copts = [
276 "-DWEBRTC_POSIX",
277 "-Wno-unused-parameter",
278 ],
279 deps = [
Alex Perry5f474f22020-02-01 12:14:24 -0800280 ":connect_fbs",
Alex Perryb3b50792020-01-18 16:13:45 -0800281 ":web_proxy_fbs",
Alex Perry5f474f22020-02-01 12:14:24 -0800282 ":web_proxy_utils",
283 "//aos/events:shm_event_loop",
Alex Perryb3b50792020-01-18 16:13:45 -0800284 "//aos/seasocks:seasocks_logger",
Alex Perryb3b50792020-01-18 16:13:45 -0800285 "//third_party:webrtc",
Austin Schuh8bd96322020-02-13 21:18:22 -0800286 "//third_party/seasocks",
Alex Perryb3b50792020-01-18 16:13:45 -0800287 "@com_github_google_glog//:glog",
288 ],
289)
290
291gen_embedded(
292 name = "gen_embedded",
293 srcs = glob(
294 include = ["www_defaults/**/*"],
295 exclude = ["www/**/*"],
296 ),
297)
298
299cc_binary(
300 name = "web_proxy_main",
301 srcs = ["web_proxy_main.cc"],
Alex Perryb3b50792020-01-18 16:13:45 -0800302 copts = [
303 "-DWEBRTC_POSIX",
304 "-Wno-unused-parameter",
305 ],
306 data = [
Alex Perry5f474f22020-02-01 12:14:24 -0800307 "//aos/events:pingpong_config.json",
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800308 "//aos/network/www:files",
309 "//aos/network/www:flatbuffers",
310 "//aos/network/www:main_bundle",
311 "@com_github_google_flatbuffers//:flatjs",
312 ],
313 deps = [
314 ":gen_embedded",
315 ":web_proxy",
316 "//aos:init",
317 "//aos/events:shm_event_loop",
318 "//aos/seasocks:seasocks_logger",
319 "//third_party/seasocks",
320 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perryb3b50792020-01-18 16:13:45 -0800321 ],
322)
Austin Schuh8bd96322020-02-13 21:18:22 -0800323
324cc_library(
325 name = "timestamp_filter",
326 hdrs = ["timestamp_filter.h"],
327 deps = [
328 "//aos/time",
329 ],
330)
331
332cc_test(
333 name = "timestamp_filter_test",
334 srcs = [
335 "timestamp_filter_test.cc",
336 ],
337 deps = [
338 ":timestamp_filter",
339 "//aos/testing:googletest",
340 ],
341)