blob: 40293c0bfa0ef22539b6d7a4b72df6b89984056f [file] [log] [blame]
James Kuszmaul418fd062022-03-22 15:22:27 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
2
Brian Silverman6470f442018-08-05 12:08:16 -07003package(default_visibility = ["//visibility:public"])
Brian Silverman100534c2015-09-07 15:51:23 -04004
Brian Silverman246cb222019-02-02 16:38:18 -08005cc_library(
6 name = "bitpacking",
7 hdrs = [
8 "bitpacking.h",
9 ],
10 visibility = ["//visibility:public"],
11 deps = [
Austin Schuhb72be802022-01-02 12:26:28 -080012 "@com_google_absl//absl/types:span",
Brian Silverman246cb222019-02-02 16:38:18 -080013 ],
14)
15
16cc_test(
17 name = "bitpacking_test",
18 srcs = [
19 "bitpacking_test.cc",
20 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080021 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman246cb222019-02-02 16:38:18 -080022 deps = [
23 ":bitpacking",
24 "//aos/testing:googletest",
25 ],
26)
27
Diana Vandenberg19bb9e22016-02-03 21:24:31 -080028py_library(
Brian Silverman6470f442018-08-05 12:08:16 -070029 name = "py_trapezoid_profile",
30 srcs = [
31 "trapezoid_profile.py",
32 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080033 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070034 deps = [
35 ":python_init",
36 ],
Diana Vandenberg19bb9e22016-02-03 21:24:31 -080037)
38
James Kuszmaul4ed5fb12022-03-22 15:20:04 -070039cc_binary(
40 name = "log_to_mcap",
41 srcs = ["log_to_mcap.cc"],
42 deps = [
43 ":mcap_logger",
44 "//aos:init",
45 "//aos/events/logging:log_reader",
46 "//frc971/control_loops:control_loops_fbs",
47 ],
48)
49
50cc_library(
51 name = "mcap_logger",
52 srcs = ["mcap_logger.cc"],
53 hdrs = ["mcap_logger.h"],
54 target_compatible_with = ["@platforms//os:linux"],
55 deps = [
56 "//aos:configuration_fbs",
57 "//aos:fast_string_builder",
58 "//aos:flatbuffer_utils",
59 "//aos/events:event_loop",
60 "@com_github_nlohmann_json//:json",
61 ],
62)
63
James Kuszmaul5c56ed32022-03-30 15:10:07 -070064cc_binary(
65 name = "generate_test_log",
66 testonly = True,
67 srcs = ["generate_test_log.cc"],
68 data = ["//aos/events:pingpong_config"],
69 deps = [
70 "//aos:configuration",
71 "//aos/events:ping_lib",
72 "//aos/events:pong_lib",
73 "//aos/events:simulated_event_loop",
74 "//aos/events/logging:log_writer",
75 "//aos/testing:path",
76 ],
77)
78
79py_test(
80 name = "log_to_mcap_test",
81 srcs = ["log_to_mcap_test.py"],
82 args = [
83 "--log_to_mcap",
84 "$(location :log_to_mcap)",
85 "--mcap",
86 "$(location @com_github_foxglove_mcap_mcap//file)",
87 "--generate_log",
88 "$(location :generate_test_log)",
89 ],
90 data = [
91 ":generate_test_log",
92 ":log_to_mcap",
93 "@com_github_foxglove_mcap_mcap//file",
94 ],
95 target_compatible_with = ["@platforms//cpu:x86_64"],
96)
97
James Kuszmaul4ed5fb12022-03-22 15:20:04 -070098cc_test(
99 name = "mcap_logger_test",
100 srcs = ["mcap_logger_test.cc"],
101 target_compatible_with = ["@platforms//os:linux"],
102 deps = [
103 ":mcap_logger",
104 "//aos/testing:googletest",
105 "@com_github_nlohmann_json//:json",
106 ],
107)
108
Brian Silverman100534c2015-09-07 15:51:23 -0400109cc_library(
James Kuszmaul0af658b2019-01-25 18:36:29 -0800110 name = "math",
111 hdrs = ["math.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800112 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul0af658b2019-01-25 18:36:29 -0800113 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700114 "@org_tuxfamily_eigen//:eigen",
James Kuszmaul0af658b2019-01-25 18:36:29 -0800115 ],
116)
117
118cc_test(
119 name = "math_test",
120 srcs = ["math_test.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800121 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul0af658b2019-01-25 18:36:29 -0800122 deps = [
123 ":math",
124 "//aos/testing:googletest",
125 ],
126)
127
128cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700129 name = "death_test_log_implementation",
130 hdrs = [
131 "death_test_log_implementation.h",
132 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800133 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700134 deps = [
John Park33858a32018-09-28 23:05:48 -0700135 "//aos/logging:implementations",
Brian Silverman6470f442018-08-05 12:08:16 -0700136 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400137)
138
139cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700140 name = "phased_loop",
141 srcs = [
142 "phased_loop.cc",
143 ],
144 hdrs = [
145 "phased_loop.h",
146 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800147 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700148 deps = [
James Kuszmaul0af658b2019-01-25 18:36:29 -0800149 "//aos/time",
Austin Schuhf257f3c2019-10-27 21:00:43 -0700150 "@com_github_google_glog//:glog",
Brian Silverman6470f442018-08-05 12:08:16 -0700151 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400152)
153
154cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700155 name = "log_interval",
156 hdrs = [
157 "log_interval.h",
158 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800159 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700160 deps = [
John Park33858a32018-09-28 23:05:48 -0700161 "//aos/logging",
James Kuszmaul0af658b2019-01-25 18:36:29 -0800162 "//aos/time",
Brian Silverman6470f442018-08-05 12:08:16 -0700163 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400164)
165
166cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700167 name = "trapezoid_profile",
168 srcs = [
169 "trapezoid_profile.cc",
170 ],
171 hdrs = [
172 "trapezoid_profile.h",
173 ],
174 linkopts = [
175 "-lm",
176 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800177 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700178 deps = [
John Park33858a32018-09-28 23:05:48 -0700179 "//aos/logging",
James Kuszmaul0af658b2019-01-25 18:36:29 -0800180 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700181 "@org_tuxfamily_eigen//:eigen",
Brian Silverman6470f442018-08-05 12:08:16 -0700182 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400183)
184
185cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700186 name = "trapezoid_profile_test",
187 srcs = [
188 "trapezoid_profile_test.cc",
189 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800190 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700191 deps = [
192 ":trapezoid_profile",
193 "//aos/testing:googletest",
194 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400195)
196
197cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700198 name = "wrapping_counter",
199 srcs = [
200 "wrapping_counter.cc",
201 ],
202 hdrs = [
203 "wrapping_counter.h",
204 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800205 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman100534c2015-09-07 15:51:23 -0400206)
207
208cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700209 name = "wrapping_counter_test",
210 srcs = [
211 "wrapping_counter_test.cc",
212 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800213 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700214 deps = [
215 ":wrapping_counter",
216 "//aos/testing:googletest",
217 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400218)
219
Austin Schuh044e18b2015-10-21 20:17:09 -0700220cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700221 name = "options",
222 hdrs = [
223 "options.h",
224 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800225 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh044e18b2015-10-21 20:17:09 -0700226)
227
Brian Silverman100534c2015-09-07 15:51:23 -0400228cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700229 name = "options_test",
230 srcs = [
231 "options_test.cc",
232 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800233 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700234 deps = [
235 ":options",
236 "//aos/testing:googletest",
237 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400238)
Brian Silverman3d37a5f2014-09-05 18:42:20 -0400239
240cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700241 name = "compiler_memory_barrier",
242 hdrs = [
243 "compiler_memory_barrier.h",
244 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800245 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman3d37a5f2014-09-05 18:42:20 -0400246)
Brian Silverman521e6ba2014-09-04 13:37:46 -0400247
248cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700249 name = "global_factory",
250 hdrs = [
251 "global_factory.h",
252 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800253 target_compatible_with = ["@platforms//os:linux"],
Parker Schuh36416692017-02-18 17:34:15 -0800254)
255
256cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700257 name = "global_factory_test",
258 srcs = [
259 "global_factory_test.cc",
260 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800261 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700262 deps = [
263 ":global_factory",
264 "//aos/testing:googletest",
265 ],
Parker Schuh36416692017-02-18 17:34:15 -0800266)
267
Brian Silvermandcaa3f72015-11-29 05:32:08 +0000268cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700269 name = "phased_loop_test",
270 srcs = [
271 "phased_loop_test.cc",
272 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800273 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700274 deps = [
275 ":phased_loop",
276 "//aos/testing:googletest",
Brian Silverman8babd8f2020-06-23 16:38:50 -0700277 "//aos/time",
Brian Silverman6470f442018-08-05 12:08:16 -0700278 ],
Brian Silvermandcaa3f72015-11-29 05:32:08 +0000279)
Brian Silverman61175fb2016-03-13 15:35:56 -0400280
281cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700282 name = "file",
283 srcs = [
284 "file.cc",
285 ],
286 hdrs = [
287 "file.h",
288 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800289 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700290 deps = [
John Park33858a32018-09-28 23:05:48 -0700291 "//aos/scoped:scoped_fd",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700292 "@com_github_google_glog//:glog",
Austin Schuhcb108412019-10-13 16:09:54 -0700293 "@com_google_absl//absl/strings",
davidjevans8b9b52f2021-09-17 08:57:30 -0700294 "@com_google_absl//absl/types:span",
Brian Silverman6470f442018-08-05 12:08:16 -0700295 ],
Brian Silverman61175fb2016-03-13 15:35:56 -0400296)
297
298cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700299 name = "file_test",
300 size = "small",
301 srcs = [
302 "file_test.cc",
303 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800304 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700305 deps = [
306 ":file",
307 "//aos/testing:googletest",
Brian Silverman6470f442018-08-05 12:08:16 -0700308 ],
309)
310
James Kuszmaul418fd062022-03-22 15:22:27 -0700311flatbuffer_cc_library(
312 name = "process_info_fbs",
313 srcs = ["process_info.fbs"],
314 gen_reflections = True,
315 target_compatible_with = ["@platforms//os:linux"],
316 visibility = ["//visibility:public"],
317)
318
319cc_library(
320 name = "top",
321 srcs = ["top.cc"],
322 hdrs = ["top.h"],
323 target_compatible_with = ["@platforms//os:linux"],
324 deps = [
325 ":process_info_fbs",
326 "//aos/containers:ring_buffer",
327 "//aos/events:event_loop",
328 "@com_github_google_glog//:glog",
329 "@com_google_absl//absl/strings",
330 ],
331)
332
333cc_test(
334 name = "top_test",
335 srcs = ["top_test.cc"],
336 data = [
337 "//aos/events:pingpong_config",
338 ],
339 flaky = True,
340 target_compatible_with = ["@platforms//os:linux"],
341 deps = [
342 ":top",
343 "//aos/events:shm_event_loop",
344 "//aos/testing:googletest",
345 "//aos/testing:path",
346 "//aos/testing:tmpdir",
347 ],
348)
349
James Kuszmaul731a05d2022-01-07 17:59:26 -0800350cc_library(
351 name = "scoped_pipe",
352 srcs = ["scoped_pipe.cc"],
353 hdrs = ["scoped_pipe.h"],
354 target_compatible_with = ["@platforms//os:linux"],
355 deps = [
356 "@com_github_google_glog//:glog",
357 "@com_google_absl//absl/types:span",
358 ],
359)
360
361cc_test(
362 name = "scoped_pipe_test",
363 srcs = ["scoped_pipe_test.cc"],
364 target_compatible_with = ["@platforms//os:linux"],
365 deps = [
366 ":scoped_pipe",
367 "//aos/testing:googletest",
368 ],
369)
370
Ravago Jonese12b7902022-02-04 22:50:44 -0800371cc_library(
372 name = "crc32",
373 srcs = ["crc32.cc"],
374 hdrs = ["crc32.h"],
375 deps = [
376 "@com_google_absl//absl/types:span",
377 ],
378)
379
Brian Silverman6470f442018-08-05 12:08:16 -0700380py_library(
381 name = "python_init",
382 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800383 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700384 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700385 deps = ["//aos:python_init"],
Brian Silverman61175fb2016-03-13 15:35:56 -0400386)
James Kuszmaule5deaa42022-06-24 16:29:31 -0700387
388cc_library(
389 name = "threaded_queue",
390 hdrs = [
391 "threaded_queue.h",
392 "threaded_queue_tmpl.h",
393 ],
394 deps = [
395 "//aos:condition",
396 "//aos/mutex",
397 ],
398)
399
400cc_test(
401 name = "threaded_queue_test",
402 srcs = ["threaded_queue_test.cc"],
403 deps = [
404 ":threaded_queue",
405 "//aos/testing:googletest",
406 ],
407)