blob: 8d21c47b914f50213a3fee76751a2ef39ea2d1ca [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
64cc_test(
65 name = "mcap_logger_test",
66 srcs = ["mcap_logger_test.cc"],
67 target_compatible_with = ["@platforms//os:linux"],
68 deps = [
69 ":mcap_logger",
70 "//aos/testing:googletest",
71 "@com_github_nlohmann_json//:json",
72 ],
73)
74
Brian Silverman100534c2015-09-07 15:51:23 -040075cc_library(
James Kuszmaul0af658b2019-01-25 18:36:29 -080076 name = "math",
77 hdrs = ["math.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080078 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul0af658b2019-01-25 18:36:29 -080079 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -070080 "@org_tuxfamily_eigen//:eigen",
James Kuszmaul0af658b2019-01-25 18:36:29 -080081 ],
82)
83
84cc_test(
85 name = "math_test",
86 srcs = ["math_test.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080087 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul0af658b2019-01-25 18:36:29 -080088 deps = [
89 ":math",
90 "//aos/testing:googletest",
91 ],
92)
93
94cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -070095 name = "death_test_log_implementation",
96 hdrs = [
97 "death_test_log_implementation.h",
98 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080099 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700100 deps = [
John Park33858a32018-09-28 23:05:48 -0700101 "//aos/logging:implementations",
Brian Silverman6470f442018-08-05 12:08:16 -0700102 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400103)
104
105cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700106 name = "phased_loop",
107 srcs = [
108 "phased_loop.cc",
109 ],
110 hdrs = [
111 "phased_loop.h",
112 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800113 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700114 deps = [
James Kuszmaul0af658b2019-01-25 18:36:29 -0800115 "//aos/time",
Austin Schuhf257f3c2019-10-27 21:00:43 -0700116 "@com_github_google_glog//:glog",
Brian Silverman6470f442018-08-05 12:08:16 -0700117 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400118)
119
120cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700121 name = "log_interval",
122 hdrs = [
123 "log_interval.h",
124 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800125 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700126 deps = [
John Park33858a32018-09-28 23:05:48 -0700127 "//aos/logging",
James Kuszmaul0af658b2019-01-25 18:36:29 -0800128 "//aos/time",
Brian Silverman6470f442018-08-05 12:08:16 -0700129 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400130)
131
132cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700133 name = "trapezoid_profile",
134 srcs = [
135 "trapezoid_profile.cc",
136 ],
137 hdrs = [
138 "trapezoid_profile.h",
139 ],
140 linkopts = [
141 "-lm",
142 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800143 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700144 deps = [
John Park33858a32018-09-28 23:05:48 -0700145 "//aos/logging",
James Kuszmaul0af658b2019-01-25 18:36:29 -0800146 "//aos/time",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700147 "@org_tuxfamily_eigen//:eigen",
Brian Silverman6470f442018-08-05 12:08:16 -0700148 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400149)
150
151cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700152 name = "trapezoid_profile_test",
153 srcs = [
154 "trapezoid_profile_test.cc",
155 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800156 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700157 deps = [
158 ":trapezoid_profile",
159 "//aos/testing:googletest",
160 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400161)
162
163cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700164 name = "wrapping_counter",
165 srcs = [
166 "wrapping_counter.cc",
167 ],
168 hdrs = [
169 "wrapping_counter.h",
170 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800171 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman100534c2015-09-07 15:51:23 -0400172)
173
174cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700175 name = "wrapping_counter_test",
176 srcs = [
177 "wrapping_counter_test.cc",
178 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800179 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700180 deps = [
181 ":wrapping_counter",
182 "//aos/testing:googletest",
183 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400184)
185
Austin Schuh044e18b2015-10-21 20:17:09 -0700186cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700187 name = "options",
188 hdrs = [
189 "options.h",
190 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800191 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh044e18b2015-10-21 20:17:09 -0700192)
193
Brian Silverman100534c2015-09-07 15:51:23 -0400194cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700195 name = "options_test",
196 srcs = [
197 "options_test.cc",
198 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800199 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700200 deps = [
201 ":options",
202 "//aos/testing:googletest",
203 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400204)
Brian Silverman3d37a5f2014-09-05 18:42:20 -0400205
206cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700207 name = "compiler_memory_barrier",
208 hdrs = [
209 "compiler_memory_barrier.h",
210 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800211 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman3d37a5f2014-09-05 18:42:20 -0400212)
Brian Silverman521e6ba2014-09-04 13:37:46 -0400213
214cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700215 name = "global_factory",
216 hdrs = [
217 "global_factory.h",
218 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800219 target_compatible_with = ["@platforms//os:linux"],
Parker Schuh36416692017-02-18 17:34:15 -0800220)
221
222cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700223 name = "global_factory_test",
224 srcs = [
225 "global_factory_test.cc",
226 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800227 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700228 deps = [
229 ":global_factory",
230 "//aos/testing:googletest",
231 ],
Parker Schuh36416692017-02-18 17:34:15 -0800232)
233
Brian Silvermandcaa3f72015-11-29 05:32:08 +0000234cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700235 name = "phased_loop_test",
236 srcs = [
237 "phased_loop_test.cc",
238 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800239 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700240 deps = [
241 ":phased_loop",
242 "//aos/testing:googletest",
Brian Silverman8babd8f2020-06-23 16:38:50 -0700243 "//aos/time",
Brian Silverman6470f442018-08-05 12:08:16 -0700244 ],
Brian Silvermandcaa3f72015-11-29 05:32:08 +0000245)
Brian Silverman61175fb2016-03-13 15:35:56 -0400246
247cc_library(
Brian Silverman6470f442018-08-05 12:08:16 -0700248 name = "file",
249 srcs = [
250 "file.cc",
251 ],
252 hdrs = [
253 "file.h",
254 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800255 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700256 deps = [
John Park33858a32018-09-28 23:05:48 -0700257 "//aos/scoped:scoped_fd",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700258 "@com_github_google_glog//:glog",
Austin Schuhcb108412019-10-13 16:09:54 -0700259 "@com_google_absl//absl/strings",
davidjevans8b9b52f2021-09-17 08:57:30 -0700260 "@com_google_absl//absl/types:span",
Brian Silverman6470f442018-08-05 12:08:16 -0700261 ],
Brian Silverman61175fb2016-03-13 15:35:56 -0400262)
263
264cc_test(
Brian Silverman6470f442018-08-05 12:08:16 -0700265 name = "file_test",
266 size = "small",
267 srcs = [
268 "file_test.cc",
269 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800270 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700271 deps = [
272 ":file",
273 "//aos/testing:googletest",
Brian Silverman6470f442018-08-05 12:08:16 -0700274 ],
275)
276
James Kuszmaul418fd062022-03-22 15:22:27 -0700277flatbuffer_cc_library(
278 name = "process_info_fbs",
279 srcs = ["process_info.fbs"],
280 gen_reflections = True,
281 target_compatible_with = ["@platforms//os:linux"],
282 visibility = ["//visibility:public"],
283)
284
285cc_library(
286 name = "top",
287 srcs = ["top.cc"],
288 hdrs = ["top.h"],
289 target_compatible_with = ["@platforms//os:linux"],
290 deps = [
291 ":process_info_fbs",
292 "//aos/containers:ring_buffer",
293 "//aos/events:event_loop",
294 "@com_github_google_glog//:glog",
295 "@com_google_absl//absl/strings",
296 ],
297)
298
299cc_test(
300 name = "top_test",
301 srcs = ["top_test.cc"],
302 data = [
303 "//aos/events:pingpong_config",
304 ],
305 flaky = True,
306 target_compatible_with = ["@platforms//os:linux"],
307 deps = [
308 ":top",
309 "//aos/events:shm_event_loop",
310 "//aos/testing:googletest",
311 "//aos/testing:path",
312 "//aos/testing:tmpdir",
313 ],
314)
315
James Kuszmaul731a05d2022-01-07 17:59:26 -0800316cc_library(
317 name = "scoped_pipe",
318 srcs = ["scoped_pipe.cc"],
319 hdrs = ["scoped_pipe.h"],
320 target_compatible_with = ["@platforms//os:linux"],
321 deps = [
322 "@com_github_google_glog//:glog",
323 "@com_google_absl//absl/types:span",
324 ],
325)
326
327cc_test(
328 name = "scoped_pipe_test",
329 srcs = ["scoped_pipe_test.cc"],
330 target_compatible_with = ["@platforms//os:linux"],
331 deps = [
332 ":scoped_pipe",
333 "//aos/testing:googletest",
334 ],
335)
336
Ravago Jonese12b7902022-02-04 22:50:44 -0800337cc_library(
338 name = "crc32",
339 srcs = ["crc32.cc"],
340 hdrs = ["crc32.h"],
341 deps = [
342 "@com_google_absl//absl/types:span",
343 ],
344)
345
Brian Silverman6470f442018-08-05 12:08:16 -0700346py_library(
347 name = "python_init",
348 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800349 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -0700350 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700351 deps = ["//aos:python_init"],
Brian Silverman61175fb2016-03-13 15:35:56 -0400352)