blob: 6a4594942e12610e6bb0d76bf577f1cca53b9986 [file] [log] [blame]
Austin Schuha1d006e2022-09-14 21:50:42 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library", "flatbuffer_rust_library")
2load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Brian Silvermand1805b62022-07-20 20:47:05 -07003load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
James Kuszmaule4aa01d2022-06-28 14:09:02 -07004load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
Brian Silverman7edd1ce2022-07-23 16:10:54 -07005load("//tools/build_rules:autocxx.bzl", "autocxx_library")
Austin Schuh972e47e2018-12-20 17:20:58 -08006
Austin Schuh00e302a2020-12-21 11:53:30 -08007exports_files(["aos_dump_autocomplete.sh"])
8
Brian Silverman258b9172015-09-19 14:32:57 -04009filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070010 name = "prime_binaries",
11 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080012 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070013 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080014 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080015 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070016 ],
17 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080018)
Austin Schuhc80dd152016-02-29 01:47:44 -080019
20filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070021 name = "prime_start_binaries",
22 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080023 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070024 ],
25 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080026)
Brian Silverman6470f442018-08-05 12:08:16 -070027
Austin Schuhc80dd152016-02-29 01:47:44 -080028filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070029 name = "prime_binaries_stripped",
30 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080031 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070032 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080033 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070034 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070035 ],
36 visibility = ["//visibility:public"],
37)
38
39filegroup(
40 name = "prime_start_binaries_stripped",
41 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080042 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070043 ],
44 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080045)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070046
47cc_library(
John Park33858a32018-09-28 23:05:48 -070048 name = "math",
49 hdrs = [
50 "commonmath.h",
51 ],
John Park33858a32018-09-28 23:05:48 -070052 visibility = ["//visibility:public"],
53)
54
Brian Silverman6470f442018-08-05 12:08:16 -070055py_library(
56 name = "python_init",
57 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080058 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070059 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070060)
John Park33858a32018-09-28 23:05:48 -070061
62cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080063 name = "macros",
64 hdrs = [
John Park33858a32018-09-28 23:05:48 -070065 "macros.h",
John Park33858a32018-09-28 23:05:48 -070066 ],
67 visibility = ["//visibility:public"],
68)
69
70cc_library(
71 name = "gtest_prod",
72 hdrs = [
73 "gtest_prod.h",
74 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070076 visibility = ["//visibility:public"],
77)
78
79cc_library(
John Park33858a32018-09-28 23:05:48 -070080 name = "unique_malloc_ptr",
81 hdrs = [
82 "unique_malloc_ptr.h",
83 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080084 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070085 visibility = ["//visibility:public"],
86)
87
88cc_library(
89 name = "condition",
90 srcs = [
91 "condition.cc",
92 ],
93 hdrs = [
94 "condition.h",
95 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080096 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070097 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -080098 deps = [
99 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -0800100 "//aos/mutex",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700101 "@com_github_google_glog//:glog",
Austin Schuh972e47e2018-12-20 17:20:58 -0800102 ],
John Park33858a32018-09-28 23:05:48 -0700103)
104
105cc_test(
106 name = "condition_test",
107 srcs = [
108 "condition_test.cc",
109 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800110 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700111 deps = [
112 ":condition",
113 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700114 "//aos/ipc_lib:aos_sync",
115 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800116 "//aos/logging",
117 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700118 "//aos/testing:googletest",
119 "//aos/testing:prevent_exit",
120 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800121 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700122 ],
123)
124
125cc_library(
126 name = "die",
127 srcs = [
128 "die.cc",
129 ],
130 hdrs = [
131 "die.h",
132 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800133 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800134 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700135 deps = [
136 "//aos:macros",
137 "//aos/libc:aos_strerror",
138 ],
John Park33858a32018-09-28 23:05:48 -0700139)
140
John Park33858a32018-09-28 23:05:48 -0700141cc_test(
142 name = "die_test",
143 srcs = [
144 "die_test.cc",
145 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800146 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700147 deps = [
148 ":die",
149 "//aos/testing:googletest",
150 ],
151)
152
John Park398c74a2018-10-20 21:17:39 -0700153cc_binary(
154 name = "dump_rtprio",
155 srcs = [
156 "dump_rtprio.cc",
157 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800158 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700159 deps = [
Austin Schuh14056182023-01-03 21:19:38 -0800160 "//aos:init",
161 "//aos/events:shm_event_loop",
Austin Schuh972e47e2018-12-20 17:20:58 -0800162 "//aos/time",
Austin Schuh14056182023-01-03 21:19:38 -0800163 "//aos/util:top",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700164 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700165 ],
166)
167
168cc_library(
John Park398c74a2018-10-20 21:17:39 -0700169 name = "init",
170 srcs = [
171 "init.cc",
172 ],
173 hdrs = [
174 "init.h",
175 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800176 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800177 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700178 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700179 ":realtime",
John Park398c74a2018-10-20 21:17:39 -0700180 "//aos:die",
Austin Schuh972e47e2018-12-20 17:20:58 -0800181 "//aos/logging:implementations",
John Park398c74a2018-10-20 21:17:39 -0700182 ],
John Park398c74a2018-10-20 21:17:39 -0700183)
184
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700185autocxx_library(
186 name = "init_rs",
187 srcs = ["init.rs"],
188 crate_name = "aos_init",
189 libs = [
190 ":init",
191 ],
192 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700193 target_compatible_with = select({
194 "//conditions:default": ["//tools/platforms/rust:has_support"],
195 "//tools:has_msan": ["@platforms//:incompatible"],
196 }),
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700197 visibility = ["//visibility:public"],
198)
199
Alex Perrycb7da4b2019-08-28 19:35:56 -0700200cc_library(
201 name = "realtime",
202 srcs = [
203 "realtime.cc",
204 ],
205 hdrs = [
206 "realtime.h",
207 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800208 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700209 visibility = ["//visibility:public"],
210 deps = [
Austin Schuhcc6070c2020-10-10 20:25:56 -0700211 ":thread_local",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700212 "@com_github_google_glog//:glog",
213 ],
214)
215
Austin Schuhcb108412019-10-13 16:09:54 -0700216flatbuffer_cc_library(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700217 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700218 srcs = ["configuration.fbs"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700219 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800220 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700221 visibility = ["//visibility:public"],
Austin Schuhcb108412019-10-13 16:09:54 -0700222)
223
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700224cc_static_flatbuffer(
225 name = "configuration_schema",
226 function = "aos::ConfigurationSchema",
227 target = ":configuration_fbs_reflection_out",
228 visibility = ["//visibility:public"],
229)
230
Alex Perryd5e13572020-02-22 15:15:08 -0800231flatbuffer_ts_library(
232 name = "configuration_ts_fbs",
233 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800234 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800235 visibility = ["//visibility:public"],
236)
237
Brian Silverman28760272020-02-02 13:21:51 -0800238flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800239 name = "configuration_fbs_python",
240 srcs = ["configuration.fbs"],
241 namespace = "aos",
242 tables = [
243 "Configuration",
244 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800245 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800246 "Map",
247 "Node",
248 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800249 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800250 visibility = ["//visibility:public"],
251)
252
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700253flatbuffer_rust_library(
254 name = "configuration_rust_fbs",
255 srcs = ["configuration.fbs"],
256 crate_name = "aos_configuration_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700257 target_compatible_with = select({
258 "//conditions:default": ["//tools/platforms/rust:has_support"],
259 "//tools:has_msan": ["@platforms//:incompatible"],
260 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700261 visibility = ["//visibility:public"],
262)
263
John Park398c74a2018-10-20 21:17:39 -0700264cc_library(
265 name = "configuration",
266 srcs = [
267 "configuration.cc",
268 ],
269 hdrs = [
270 "configuration.h",
271 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800272 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800273 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700274 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700275 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700276 ":flatbuffer_merge",
277 ":flatbuffers",
278 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700279 "//aos:unique_malloc_ptr",
Austin Schuh83cbb1e2023-06-23 12:59:02 -0700280 "//aos/ipc_lib:index",
Austin Schuh217a9782019-12-21 23:02:50 -0800281 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700282 "//aos/util:file",
283 "@com_github_google_glog//:glog",
284 "@com_google_absl//absl/container:btree",
285 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700286 ],
John Park398c74a2018-10-20 21:17:39 -0700287)
288
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700289cc_library(
290 name = "configuration_for_rust",
291 srcs = [
292 "configuration_for_rust.cc",
293 ],
294 hdrs = [
295 "configuration_for_rust.h",
296 ],
297 deps = [
298 ":configuration",
299 ":for_rust",
300 "//third_party/cargo:cxx_cc",
301 ],
302)
303
304autocxx_library(
305 name = "configuration_rs",
306 srcs = ["configuration.rs"],
307 crate_name = "aos_configuration",
308 libs = [
309 ":configuration",
310 ":configuration_for_rust",
311 ":configuration_fbs",
312 ],
313 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700314 target_compatible_with = select({
315 "//conditions:default": ["//tools/platforms/rust:has_support"],
316 "//tools:has_msan": ["@platforms//:incompatible"],
317 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700318 visibility = ["//visibility:public"],
319 deps = [
320 ":configuration_rust_fbs",
321 ":flatbuffers_rs",
322 "//third_party/cargo:thiserror",
323 ],
324)
325
326rust_test(
327 name = "configuration_rs_test",
328 crate = ":configuration_rs",
329 data = [
330 "//aos/testdata:test_configs",
331 ],
332 # TODO: Make Rust play happy with pic vs nopic. Details at:
333 # https://github.com/bazelbuild/rules_rust/issues/118
334 rustc_flags = ["-Crelocation-model=static"],
335)
336
James Kuszmaulabb77132020-08-01 19:56:16 -0700337flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800338 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700339 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800340 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700341 visibility = ["//aos:__subpackages__"],
342)
343
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700344flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800345 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700346 srcs = ["json_to_flatbuffer.fbs"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800347 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800348 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700349 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700350)
351
Brian Silvermand1805b62022-07-20 20:47:05 -0700352flatbuffer_rust_library(
353 name = "json_to_flatbuffer_rust_fbs",
354 srcs = ["json_to_flatbuffer.fbs"],
355 crate_name = "aos_json_to_flatbuffer_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700356 target_compatible_with = select({
357 "//conditions:default": ["//tools/platforms/rust:has_support"],
358 "//tools:has_msan": ["@platforms//:incompatible"],
359 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700360 visibility = ["//aos:__subpackages__"],
361)
362
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700363cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700364 name = "flatbuffer_utils",
365 srcs = ["flatbuffer_utils.cc"],
366 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800367 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700368 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700369 deps = [
370 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800371 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700372 ],
373)
374
375cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700376 name = "json_tokenizer",
377 srcs = ["json_tokenizer.cc"],
378 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800379 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700380 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700381 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700382 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700383 "@com_google_absl//absl/strings",
384 ],
385)
386
387cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700388 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800389 srcs = [
390 "flatbuffer_introspection.cc",
391 "json_to_flatbuffer.cc",
392 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700393 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800394 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700395 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700396 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700397 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700398 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700399 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700400 ":json_tokenizer",
Austin Schuhbba10282021-03-20 22:03:28 -0700401 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700402 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700403 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700404 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700405 ],
406)
407
408cc_test(
409 name = "json_to_flatbuffer_test",
410 srcs = [
411 "json_to_flatbuffer_test.cc",
412 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800413 data = [
414 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800415 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800416 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800417 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700418 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800419 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700420 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800421 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700422 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700423 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700424 ],
425)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700426
Tyler Chatow5e369a42019-11-23 11:57:31 -0800427cc_test(
428 name = "flatbuffer_introspection_test",
429 srcs = [
430 "flatbuffer_introspection_test.cc",
431 ],
432 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800433 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800434 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800435 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800436 deps = [
437 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800438 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800439 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700440 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800441 "//aos/util:file",
442 "@com_github_google_flatbuffers//:flatbuffers",
443 ],
444)
445
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700446cc_library(
447 name = "flatbuffer_merge",
448 srcs = ["flatbuffer_merge.cc"],
449 hdrs = ["flatbuffer_merge.h"],
450 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800451 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700452 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700453 deps = [
454 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700455 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700456 "@com_github_google_flatbuffers//:flatbuffers",
457 ],
458)
459
460cc_test(
461 name = "flatbuffer_merge_test",
462 srcs = [
463 "flatbuffer_merge_test.cc",
464 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800465 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700466 deps = [
467 ":flatbuffer_merge",
468 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800469 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700470 "//aos/testing:googletest",
471 ],
472)
Austin Schuhe93d8642019-10-13 15:27:07 -0700473
474cc_library(
475 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700476 srcs = [
477 "flatbuffers.cc",
478 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700479 hdrs = [
480 "flatbuffers.h",
481 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800482 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700483 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700484 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800485 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700486 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700487 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700488 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700489 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700490 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800491 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700492 ],
493)
Austin Schuhcb108412019-10-13 16:09:54 -0700494
Brian Silvermand1805b62022-07-20 20:47:05 -0700495rust_library(
496 name = "flatbuffers_rs",
497 srcs = ["flatbuffers.rs"],
498 crate_name = "aos_flatbuffers",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700499 target_compatible_with = select({
500 "//conditions:default": ["//tools/platforms/rust:has_support"],
501 "//tools:has_msan": ["@platforms//:incompatible"],
502 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700503 visibility = ["//visibility:public"],
504 deps = [
505 "@com_github_google_flatbuffers//rust",
506 ],
507)
508
509rust_test(
510 name = "flatbuffers_rs_test",
511 crate = ":flatbuffers_rs",
512 deps = [
513 ":json_to_flatbuffer_rust_fbs",
514 ],
515)
516
Austin Schuhcb108412019-10-13 16:09:54 -0700517cc_test(
518 name = "configuration_test",
519 srcs = [
520 "configuration_test.cc",
521 ],
522 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700523 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700524 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700525 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700526 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700527 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800528 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700529 deps = [
530 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700531 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800532 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700533 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700534 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700535 "//aos/testing:test_logging",
536 ],
537)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700538
539cc_binary(
540 name = "config_flattener",
541 srcs = [
542 "config_flattener.cc",
543 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800544 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700545 visibility = ["//visibility:public"],
546 deps = [
547 ":configuration",
548 ":init",
549 "//aos/util:file",
550 "@com_github_google_glog//:glog",
551 ],
552)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800553
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800554cc_library(
555 name = "aos_cli_utils",
556 srcs = [
557 "aos_cli_utils.cc",
558 ],
559 hdrs = [
560 "aos_cli_utils.h",
561 ],
562 target_compatible_with = ["@platforms//os:linux"],
563 visibility = ["//visibility:public"],
564 deps = [
565 ":configuration",
566 "//aos:init",
567 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700568 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800569 "@com_github_google_glog//:glog",
570 ],
571)
572
Tyler Chatow5e369a42019-11-23 11:57:31 -0800573cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800574 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800575 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800576 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800577 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800578 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800579 visibility = ["//visibility:public"],
580 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800581 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800582 ":configuration",
583 ":json_to_flatbuffer",
584 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800585 "@com_github_google_glog//:glog",
586 ],
587)
588
589cc_binary(
590 name = "aos_send",
591 srcs = [
592 "aos_send.cc",
593 ],
594 target_compatible_with = ["@platforms//os:linux"],
595 visibility = ["//visibility:public"],
596 deps = [
597 ":aos_cli_utils",
598 ":configuration",
599 ":init",
600 ":json_to_flatbuffer",
601 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800602 "@com_github_google_glog//:glog",
603 ],
604)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500605
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700606cc_binary(
607 name = "aos_graph_nodes",
608 srcs = [
609 "aos_graph_nodes.cc",
610 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800611 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700612 visibility = ["//visibility:public"],
613 deps = [
614 ":configuration",
615 ":json_to_flatbuffer",
616 "//aos:init",
617 "//aos/events:shm_event_loop",
618 "@com_github_google_glog//:glog",
619 ],
620)
621
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500622cc_library(
623 name = "ftrace",
624 srcs = [
625 "ftrace.cc",
626 ],
627 hdrs = [
628 "ftrace.h",
629 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800630 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500631 visibility = ["//visibility:public"],
632 deps = [
633 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800634 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500635 ],
636)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700637
638cc_library(
639 name = "fast_string_builder",
640 srcs = [
641 "fast_string_builder.cc",
642 ],
643 hdrs = [
644 "fast_string_builder.h",
645 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800646 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700647 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700648 deps = [
649 "@com_github_google_glog//:glog",
650 "@com_google_absl//absl/strings",
651 "@com_google_absl//absl/strings:str_format",
652 ],
653)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700654
655cc_library(
656 name = "thread_local",
657 hdrs = [
658 "thread_local.h",
659 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800660 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb47f5552020-10-01 15:08:14 -0700661 visibility = ["//visibility:public"],
662)
Austin Schuhcc6070c2020-10-10 20:25:56 -0700663
664cc_test(
665 name = "realtime_test",
666 srcs = [
667 "realtime_test.cc",
668 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800669 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700670 visibility = ["//visibility:public"],
671 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700672 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700673 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700674 "@com_github_gflags_gflags//:gflags",
675 "@com_github_google_glog//:glog",
676 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700677 ],
678)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800679
680cc_test(
681 name = "flatbuffers_test",
682 srcs = [
683 "flatbuffers_test.cc",
684 ],
685 deps = [
686 ":flatbuffers",
687 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800688 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800689 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700690 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800691 ],
692)
Austin Schuh0de30f32020-12-06 12:44:28 -0800693
694py_binary(
695 name = "flatbuffers_static",
696 srcs = ["flatbuffers_static.py"],
697 visibility = ["//visibility:public"],
698)
Austin Schuh4385b142021-03-14 21:31:13 -0700699
700cc_library(
701 name = "uuid",
702 srcs = ["uuid.cc"],
703 hdrs = ["uuid.h"],
704 target_compatible_with = ["@platforms//os:linux"],
705 visibility = ["//visibility:public"],
706 deps = [
Austin Schuh81d0fe42022-08-17 16:29:23 -0700707 ":thread_local",
Austin Schuh8902fa52021-03-14 22:39:24 -0700708 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700709 "@com_github_google_flatbuffers//:flatbuffers",
710 "@com_github_google_glog//:glog",
711 "@com_google_absl//absl/types:span",
712 ],
713)
714
715cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700716 name = "uuid_collision_test",
717 srcs = ["uuid_collision_test.cc"],
718 target_compatible_with = ["@platforms//os:linux"],
719 deps = [
720 ":uuid",
721 "//aos/testing:googletest",
722 ],
723)
724
725cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700726 name = "uuid_test",
727 srcs = ["uuid_test.cc"],
728 target_compatible_with = ["@platforms//os:linux"],
729 deps = [
730 ":uuid",
731 "//aos/testing:googletest",
732 ],
733)
Austin Schuh30f74292021-08-13 17:25:26 -0700734
Brian Silverman10599932022-08-15 06:05:53 -0700735cc_library(
736 name = "uuid_for_rust",
737 hdrs = ["uuid_for_rust.h"],
738 deps = [
739 ":uuid",
740 ],
741)
742
743autocxx_library(
744 name = "uuid_rs",
745 srcs = ["uuid.rs"],
746 crate_name = "aos_uuid",
747 libs = [
748 ":uuid",
749 ":uuid_for_rust",
750 ],
751 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
752 rs_deps = [
753 "//third_party/cargo:uuid",
754 ],
Austin Schuhdfa127f2022-10-26 21:17:42 -0700755 target_compatible_with = select({
756 "//conditions:default": ["//tools/platforms/rust:has_support"],
757 "//tools:has_msan": ["@platforms//:incompatible"],
758 }),
Brian Silverman10599932022-08-15 06:05:53 -0700759 visibility = ["//visibility:public"],
760)
761
Austin Schuh30f74292021-08-13 17:25:26 -0700762cc_binary(
763 name = "aos_graph_channels",
764 srcs = [
765 "aos_graph_channels.cc",
766 ],
767 target_compatible_with = ["@platforms//os:linux"],
768 deps = [
769 "//aos:configuration",
770 "//aos:init",
771 "//aos:json_to_flatbuffer",
772 "//aos/events:simulated_event_loop",
773 "//aos/events/logging:log_reader",
774 "//aos/time",
775 "@com_github_gflags_gflags//:gflags",
776 "@com_github_google_glog//:glog",
777 ],
778)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700779
780cc_library(
781 name = "for_rust",
782 hdrs = [
783 "for_rust.h",
784 ],
785 visibility = ["//visibility:public"],
786 deps = [
787 "//third_party/cargo:cxx_cc",
788 ],
789)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700790
791cc_library(
792 name = "sha256",
793 srcs = [
794 "sha256.cc",
795 ],
796 hdrs = ["sha256.h"],
797 target_compatible_with = ["@platforms//os:linux"],
798 visibility = ["//visibility:public"],
799 deps = [
800 "@boringssl//:crypto",
801 "@com_google_absl//absl/types:span",
802 ],
803)