blob: d9781f9e88c00ce08a8b593f01fd50b3692bb355 [file] [log] [blame]
Adam Snaider0967b812023-11-02 15:29:43 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library")
James Kuszmaulf01da392023-12-14 11:22:14 -08002load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Austin Schuha1d006e2022-09-14 21:50:42 -07003load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
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")
Adam Snaider0967b812023-11-02 15:29:43 -07006load("//tools/rust:defs.bzl", "flatbuffer_rust_library", "rust_library", "rust_test")
Austin Schuh972e47e2018-12-20 17:20:58 -08007
Austin Schuh00e302a2020-12-21 11:53:30 -08008exports_files(["aos_dump_autocomplete.sh"])
9
Brian Silverman258b9172015-09-19 14:32:57 -040010filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070011 name = "prime_binaries",
12 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080013 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070014 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080015 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080016 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070017 ],
18 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080019)
Austin Schuhc80dd152016-02-29 01:47:44 -080020
21filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070022 name = "prime_start_binaries",
23 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080024 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070025 ],
26 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080027)
Brian Silverman6470f442018-08-05 12:08:16 -070028
Austin Schuhc80dd152016-02-29 01:47:44 -080029filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070030 name = "prime_binaries_stripped",
31 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080032 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070033 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080034 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070035 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070036 ],
37 visibility = ["//visibility:public"],
38)
39
40filegroup(
41 name = "prime_start_binaries_stripped",
42 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080043 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070044 ],
45 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080046)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070047
48cc_library(
John Park33858a32018-09-28 23:05:48 -070049 name = "math",
50 hdrs = [
51 "commonmath.h",
52 ],
John Park33858a32018-09-28 23:05:48 -070053 visibility = ["//visibility:public"],
54)
55
Brian Silverman6470f442018-08-05 12:08:16 -070056py_library(
57 name = "python_init",
58 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080059 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070060 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070061)
John Park33858a32018-09-28 23:05:48 -070062
63cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080064 name = "macros",
65 hdrs = [
John Park33858a32018-09-28 23:05:48 -070066 "macros.h",
John Park33858a32018-09-28 23:05:48 -070067 ],
68 visibility = ["//visibility:public"],
69)
70
71cc_library(
72 name = "gtest_prod",
73 hdrs = [
74 "gtest_prod.h",
75 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080076 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070077 visibility = ["//visibility:public"],
78)
79
80cc_library(
John Park33858a32018-09-28 23:05:48 -070081 name = "unique_malloc_ptr",
82 hdrs = [
83 "unique_malloc_ptr.h",
84 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080085 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070086 visibility = ["//visibility:public"],
87)
88
89cc_library(
90 name = "condition",
91 srcs = [
92 "condition.cc",
93 ],
94 hdrs = [
95 "condition.h",
96 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080097 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070098 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -080099 deps = [
100 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -0800101 "//aos/mutex",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700102 "@com_github_google_glog//:glog",
Austin Schuh972e47e2018-12-20 17:20:58 -0800103 ],
John Park33858a32018-09-28 23:05:48 -0700104)
105
106cc_test(
107 name = "condition_test",
108 srcs = [
109 "condition_test.cc",
110 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800111 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700112 deps = [
113 ":condition",
114 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700115 "//aos/ipc_lib:aos_sync",
116 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800117 "//aos/logging",
118 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700119 "//aos/testing:googletest",
120 "//aos/testing:prevent_exit",
121 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800122 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700123 ],
124)
125
126cc_library(
127 name = "die",
128 srcs = [
129 "die.cc",
130 ],
131 hdrs = [
132 "die.h",
133 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800134 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800135 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700136 deps = [
137 "//aos:macros",
138 "//aos/libc:aos_strerror",
139 ],
John Park33858a32018-09-28 23:05:48 -0700140)
141
John Park33858a32018-09-28 23:05:48 -0700142cc_test(
143 name = "die_test",
144 srcs = [
145 "die_test.cc",
146 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800147 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700148 deps = [
149 ":die",
150 "//aos/testing:googletest",
151 ],
152)
153
John Park398c74a2018-10-20 21:17:39 -0700154cc_binary(
155 name = "dump_rtprio",
156 srcs = [
157 "dump_rtprio.cc",
158 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800159 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700160 deps = [
Austin Schuh14056182023-01-03 21:19:38 -0800161 "//aos:init",
162 "//aos/events:shm_event_loop",
Austin Schuh972e47e2018-12-20 17:20:58 -0800163 "//aos/time",
Austin Schuh14056182023-01-03 21:19:38 -0800164 "//aos/util:top",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700165 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700166 ],
167)
168
169cc_library(
John Park398c74a2018-10-20 21:17:39 -0700170 name = "init",
171 srcs = [
172 "init.cc",
173 ],
174 hdrs = [
175 "init.h",
176 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800177 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800178 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700179 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700180 ":realtime",
James Kuszmaula791b762023-07-13 14:56:21 -0700181 ":uuid",
John Park398c74a2018-10-20 21:17:39 -0700182 "//aos:die",
Austin Schuhfc0caa82023-08-25 14:25:03 -0700183 "//aos/logging",
John Park398c74a2018-10-20 21:17:39 -0700184 ],
John Park398c74a2018-10-20 21:17:39 -0700185)
186
Adam Snaider48a62f32023-10-02 15:49:23 -0700187cc_library(
188 name = "init_for_rust",
189 srcs = [
190 "init_for_rust.cc",
191 ],
192 hdrs = [
193 "init_for_rust.h",
194 ],
195 deps = [
196 ":for_rust",
197 ":init",
198 "//aos/logging",
199 "@com_github_gflags_gflags//:gflags",
200 "@crate_index//:cxx_cc",
201 ],
202)
203
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700204autocxx_library(
205 name = "init_rs",
206 srcs = ["init.rs"],
207 crate_name = "aos_init",
208 libs = [
Adam Snaider48a62f32023-10-02 15:49:23 -0700209 ":init_for_rust",
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700210 ],
211 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700212 visibility = ["//visibility:public"],
Adam Snaider48a62f32023-10-02 15:49:23 -0700213 deps = [
214 "@crate_index//:clap",
215 ],
216)
217
218rust_test(
219 name = "init_rs_test",
220 crate = ":init_rs",
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700221)
222
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700223autocxx_library(
224 name = "test_init_rs",
225 testonly = True,
226 srcs = ["test_init.rs"],
227 crate_name = "aos_test_init",
Adam Snaider5f000672023-11-02 16:04:30 -0700228 docs = False,
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700229 libs = [
230 "//aos/testing:tmpdir",
231 ],
232 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700233 visibility = ["//visibility:public"],
234 deps = [
235 ":init_rs",
236 ],
237)
238
Alex Perrycb7da4b2019-08-28 19:35:56 -0700239cc_library(
240 name = "realtime",
241 srcs = [
242 "realtime.cc",
243 ],
244 hdrs = [
245 "realtime.h",
246 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800247 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700248 visibility = ["//visibility:public"],
249 deps = [
James Kuszmaula791b762023-07-13 14:56:21 -0700250 ":uuid",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700251 "@com_github_google_glog//:glog",
252 ],
253)
254
James Kuszmaulf01da392023-12-14 11:22:14 -0800255static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700256 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700257 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800258 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700259 visibility = ["//visibility:public"],
James Kuszmaul1e57af92023-12-20 15:34:54 -0800260 deps = ["//aos/flatbuffers/reflection:reflection_fbs"],
Austin Schuhcb108412019-10-13 16:09:54 -0700261)
262
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700263cc_static_flatbuffer(
264 name = "configuration_schema",
265 function = "aos::ConfigurationSchema",
266 target = ":configuration_fbs_reflection_out",
267 visibility = ["//visibility:public"],
268)
269
Alex Perryd5e13572020-02-22 15:15:08 -0800270flatbuffer_ts_library(
271 name = "configuration_ts_fbs",
272 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800273 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800274 visibility = ["//visibility:public"],
275)
276
Brian Silverman28760272020-02-02 13:21:51 -0800277flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800278 name = "configuration_fbs_python",
279 srcs = ["configuration.fbs"],
280 namespace = "aos",
281 tables = [
282 "Configuration",
283 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800284 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800285 "Map",
286 "Node",
287 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800288 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800289 visibility = ["//visibility:public"],
290)
291
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700292flatbuffer_rust_library(
293 name = "configuration_rust_fbs",
294 srcs = ["configuration.fbs"],
295 crate_name = "aos_configuration_fbs",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700296 visibility = ["//visibility:public"],
297)
298
John Park398c74a2018-10-20 21:17:39 -0700299cc_library(
300 name = "configuration",
301 srcs = [
302 "configuration.cc",
303 ],
304 hdrs = [
305 "configuration.h",
306 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800307 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800308 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700309 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700310 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700311 ":flatbuffer_merge",
312 ":flatbuffers",
313 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700314 "//aos:unique_malloc_ptr",
Austin Schuh83cbb1e2023-06-23 12:59:02 -0700315 "//aos/ipc_lib:index",
Austin Schuh217a9782019-12-21 23:02:50 -0800316 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700317 "//aos/util:file",
318 "@com_github_google_glog//:glog",
319 "@com_google_absl//absl/container:btree",
320 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700321 ],
John Park398c74a2018-10-20 21:17:39 -0700322)
323
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700324cc_library(
325 name = "configuration_for_rust",
326 srcs = [
327 "configuration_for_rust.cc",
328 ],
329 hdrs = [
330 "configuration_for_rust.h",
331 ],
332 deps = [
333 ":configuration",
334 ":for_rust",
Adam Snaider770b97b2023-08-04 21:07:48 -0700335 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700336 ],
337)
338
339autocxx_library(
340 name = "configuration_rs",
341 srcs = ["configuration.rs"],
342 crate_name = "aos_configuration",
343 libs = [
344 ":configuration",
345 ":configuration_for_rust",
346 ":configuration_fbs",
347 ],
348 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700349 visibility = ["//visibility:public"],
350 deps = [
351 ":configuration_rust_fbs",
352 ":flatbuffers_rs",
Adam Snaider770b97b2023-08-04 21:07:48 -0700353 "@crate_index//:thiserror",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700354 ],
355)
356
357rust_test(
358 name = "configuration_rs_test",
359 crate = ":configuration_rs",
360 data = [
361 "//aos/testdata:test_configs",
362 ],
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700363)
364
James Kuszmaulabb77132020-08-01 19:56:16 -0700365flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800366 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700367 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800368 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700369 visibility = ["//aos:__subpackages__"],
370)
371
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700372flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800373 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700374 srcs = ["json_to_flatbuffer.fbs"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800375 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800376 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700377 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700378)
379
Brian Silvermand1805b62022-07-20 20:47:05 -0700380flatbuffer_rust_library(
381 name = "json_to_flatbuffer_rust_fbs",
382 srcs = ["json_to_flatbuffer.fbs"],
383 crate_name = "aos_json_to_flatbuffer_fbs",
Brian Silvermand1805b62022-07-20 20:47:05 -0700384 visibility = ["//aos:__subpackages__"],
385)
386
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700387cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700388 name = "flatbuffer_utils",
389 srcs = ["flatbuffer_utils.cc"],
390 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800391 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700392 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700393 deps = [
394 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800395 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700396 ],
397)
398
399cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700400 name = "json_tokenizer",
401 srcs = ["json_tokenizer.cc"],
402 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800403 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700404 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700405 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700406 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700407 "@com_google_absl//absl/strings",
408 ],
409)
410
411cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700412 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800413 srcs = [
414 "flatbuffer_introspection.cc",
415 "json_to_flatbuffer.cc",
416 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700417 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800418 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700419 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700420 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700421 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700422 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700423 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700424 ":json_tokenizer",
James Kuszmaulf5eb4682023-09-22 17:16:59 -0700425 "//aos/flatbuffers:builder",
Austin Schuhbba10282021-03-20 22:03:28 -0700426 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700427 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700428 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700429 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700430 ],
431)
432
433cc_test(
434 name = "json_to_flatbuffer_test",
435 srcs = [
436 "json_to_flatbuffer_test.cc",
437 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800438 data = [
439 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800440 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800441 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800442 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700443 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800444 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700445 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800446 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700447 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700448 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700449 ],
450)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700451
Tyler Chatow5e369a42019-11-23 11:57:31 -0800452cc_test(
453 name = "flatbuffer_introspection_test",
454 srcs = [
455 "flatbuffer_introspection_test.cc",
456 ],
457 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800458 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800459 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800460 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800461 deps = [
462 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800463 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800464 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700465 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800466 "//aos/util:file",
467 "@com_github_google_flatbuffers//:flatbuffers",
468 ],
469)
470
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700471cc_library(
472 name = "flatbuffer_merge",
473 srcs = ["flatbuffer_merge.cc"],
474 hdrs = ["flatbuffer_merge.h"],
475 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800476 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700477 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700478 deps = [
479 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700480 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700481 "@com_github_google_flatbuffers//:flatbuffers",
482 ],
483)
484
485cc_test(
486 name = "flatbuffer_merge_test",
487 srcs = [
488 "flatbuffer_merge_test.cc",
489 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800490 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700491 deps = [
492 ":flatbuffer_merge",
493 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800494 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700495 "//aos/testing:googletest",
496 ],
497)
Austin Schuhe93d8642019-10-13 15:27:07 -0700498
499cc_library(
500 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700501 srcs = [
502 "flatbuffers.cc",
503 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700504 hdrs = [
505 "flatbuffers.h",
506 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800507 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700508 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700509 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800510 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700511 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700512 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700513 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700514 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700515 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800516 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700517 ],
518)
Austin Schuhcb108412019-10-13 16:09:54 -0700519
Brian Silvermand1805b62022-07-20 20:47:05 -0700520rust_library(
521 name = "flatbuffers_rs",
522 srcs = ["flatbuffers.rs"],
523 crate_name = "aos_flatbuffers",
Brian Silvermand1805b62022-07-20 20:47:05 -0700524 visibility = ["//visibility:public"],
525 deps = [
526 "@com_github_google_flatbuffers//rust",
527 ],
528)
529
530rust_test(
531 name = "flatbuffers_rs_test",
532 crate = ":flatbuffers_rs",
533 deps = [
534 ":json_to_flatbuffer_rust_fbs",
535 ],
536)
537
Austin Schuhcb108412019-10-13 16:09:54 -0700538cc_test(
539 name = "configuration_test",
540 srcs = [
541 "configuration_test.cc",
542 ],
543 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700544 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700545 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700546 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700547 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700548 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800549 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700550 deps = [
551 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700552 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800553 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700554 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700555 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700556 "//aos/testing:test_logging",
557 ],
558)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700559
560cc_binary(
561 name = "config_flattener",
562 srcs = [
563 "config_flattener.cc",
564 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800565 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700566 visibility = ["//visibility:public"],
567 deps = [
568 ":configuration",
569 ":init",
570 "//aos/util:file",
571 "@com_github_google_glog//:glog",
572 ],
573)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800574
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800575cc_library(
576 name = "aos_cli_utils",
577 srcs = [
578 "aos_cli_utils.cc",
579 ],
580 hdrs = [
581 "aos_cli_utils.h",
582 ],
583 target_compatible_with = ["@platforms//os:linux"],
584 visibility = ["//visibility:public"],
585 deps = [
586 ":configuration",
587 "//aos:init",
588 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700589 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800590 "@com_github_google_glog//:glog",
591 ],
592)
593
Tyler Chatow5e369a42019-11-23 11:57:31 -0800594cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800595 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800596 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800597 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800598 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800599 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800600 visibility = ["//visibility:public"],
601 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800602 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800603 ":configuration",
604 ":json_to_flatbuffer",
605 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800606 "@com_github_google_glog//:glog",
607 ],
608)
609
610cc_binary(
611 name = "aos_send",
612 srcs = [
613 "aos_send.cc",
614 ],
615 target_compatible_with = ["@platforms//os:linux"],
616 visibility = ["//visibility:public"],
617 deps = [
618 ":aos_cli_utils",
619 ":configuration",
620 ":init",
621 ":json_to_flatbuffer",
622 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800623 "@com_github_google_glog//:glog",
624 ],
625)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500626
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700627cc_binary(
628 name = "aos_graph_nodes",
629 srcs = [
630 "aos_graph_nodes.cc",
631 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800632 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700633 visibility = ["//visibility:public"],
634 deps = [
635 ":configuration",
636 ":json_to_flatbuffer",
637 "//aos:init",
638 "//aos/events:shm_event_loop",
639 "@com_github_google_glog//:glog",
640 ],
641)
642
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500643cc_library(
644 name = "ftrace",
645 srcs = [
646 "ftrace.cc",
647 ],
648 hdrs = [
649 "ftrace.h",
650 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800651 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500652 visibility = ["//visibility:public"],
653 deps = [
654 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800655 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500656 ],
657)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700658
659cc_library(
660 name = "fast_string_builder",
661 srcs = [
662 "fast_string_builder.cc",
663 ],
664 hdrs = [
665 "fast_string_builder.h",
666 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800667 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700668 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700669 deps = [
670 "@com_github_google_glog//:glog",
671 "@com_google_absl//absl/strings",
672 "@com_google_absl//absl/strings:str_format",
673 ],
674)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700675
Austin Schuhcc6070c2020-10-10 20:25:56 -0700676cc_test(
677 name = "realtime_test",
678 srcs = [
679 "realtime_test.cc",
680 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800681 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700682 visibility = ["//visibility:public"],
683 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700684 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700685 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700686 "@com_github_gflags_gflags//:gflags",
687 "@com_github_google_glog//:glog",
688 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700689 ],
690)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800691
692cc_test(
693 name = "flatbuffers_test",
694 srcs = [
695 "flatbuffers_test.cc",
696 ],
697 deps = [
698 ":flatbuffers",
699 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800700 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800701 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700702 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800703 ],
704)
Austin Schuh0de30f32020-12-06 12:44:28 -0800705
706py_binary(
707 name = "flatbuffers_static",
708 srcs = ["flatbuffers_static.py"],
709 visibility = ["//visibility:public"],
710)
Austin Schuh4385b142021-03-14 21:31:13 -0700711
712cc_library(
713 name = "uuid",
714 srcs = ["uuid.cc"],
715 hdrs = ["uuid.h"],
716 target_compatible_with = ["@platforms//os:linux"],
717 visibility = ["//visibility:public"],
718 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700719 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700720 "@com_github_google_flatbuffers//:flatbuffers",
721 "@com_github_google_glog//:glog",
722 "@com_google_absl//absl/types:span",
723 ],
724)
725
726cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700727 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700728 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700729 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700730 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700731 target_compatible_with = ["@platforms//os:linux"],
732 deps = [
733 ":uuid",
734 "//aos/testing:googletest",
735 ],
736)
737
738cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700739 name = "uuid_test",
740 srcs = ["uuid_test.cc"],
741 target_compatible_with = ["@platforms//os:linux"],
742 deps = [
743 ":uuid",
744 "//aos/testing:googletest",
745 ],
746)
Austin Schuh30f74292021-08-13 17:25:26 -0700747
Brian Silverman10599932022-08-15 06:05:53 -0700748cc_library(
749 name = "uuid_for_rust",
750 hdrs = ["uuid_for_rust.h"],
751 deps = [
752 ":uuid",
753 ],
754)
755
756autocxx_library(
757 name = "uuid_rs",
758 srcs = ["uuid.rs"],
759 crate_name = "aos_uuid",
760 libs = [
761 ":uuid",
762 ":uuid_for_rust",
763 ],
764 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
765 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700766 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700767 ],
Brian Silverman10599932022-08-15 06:05:53 -0700768 visibility = ["//visibility:public"],
769)
770
Austin Schuh30f74292021-08-13 17:25:26 -0700771cc_binary(
772 name = "aos_graph_channels",
773 srcs = [
774 "aos_graph_channels.cc",
775 ],
776 target_compatible_with = ["@platforms//os:linux"],
777 deps = [
778 "//aos:configuration",
779 "//aos:init",
780 "//aos:json_to_flatbuffer",
781 "//aos/events:simulated_event_loop",
782 "//aos/events/logging:log_reader",
783 "//aos/time",
784 "@com_github_gflags_gflags//:gflags",
785 "@com_github_google_glog//:glog",
786 ],
787)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700788
789cc_library(
790 name = "for_rust",
791 hdrs = [
792 "for_rust.h",
793 ],
794 visibility = ["//visibility:public"],
795 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700796 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700797 ],
798)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700799
800cc_library(
801 name = "sha256",
802 srcs = [
803 "sha256.cc",
804 ],
805 hdrs = ["sha256.h"],
806 target_compatible_with = ["@platforms//os:linux"],
807 visibility = ["//visibility:public"],
808 deps = [
James Kuszmaul56802ab2023-08-23 15:18:34 -0700809 "//aos/util:file",
Austin Schuhb0e439d2023-05-15 10:55:40 -0700810 "@boringssl//:crypto",
811 "@com_google_absl//absl/types:span",
812 ],
813)
James Kuszmaul56802ab2023-08-23 15:18:34 -0700814
815cc_test(
816 name = "sha256_test",
817 srcs = ["sha256_test.cc"],
818 deps = [
819 ":sha256",
820 "//aos/testing:googletest",
821 "//aos/testing:tmpdir",
822 ],
823)