blob: 880985f09a03332ac689bf61f996de206b85e1c4 [file] [log] [blame]
Adam Snaider0967b812023-11-02 15:29:43 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library")
Austin Schuha1d006e2022-09-14 21:50:42 -07002load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
James Kuszmaule4aa01d2022-06-28 14:09:02 -07003load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
Austin Schuh8f99c822024-05-05 22:43:40 -07004load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Brian Silverman7edd1ce2022-07-23 16:10:54 -07005load("//tools/build_rules:autocxx.bzl", "autocxx_library")
Adam Snaiderf560ae92023-11-07 17:06:21 -08006load("//tools/rust:defs.bzl", "flatbuffer_rust_library", "rust_library")
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",
Adam Snaider9121b302023-12-14 15:30:54 -0800215 "@crate_index//:env_logger",
Adam Snaider48a62f32023-10-02 15:49:23 -0700216 ],
217)
218
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700219autocxx_library(
220 name = "test_init_rs",
221 testonly = True,
222 srcs = ["test_init.rs"],
223 crate_name = "aos_test_init",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800224 gen_docs = False,
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700225 libs = [
226 "//aos/testing:tmpdir",
227 ],
228 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700229 visibility = ["//visibility:public"],
230 deps = [
231 ":init_rs",
Adam Snaider9121b302023-12-14 15:30:54 -0800232 "@crate_index//:env_logger",
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700233 ],
234)
235
Alex Perrycb7da4b2019-08-28 19:35:56 -0700236cc_library(
237 name = "realtime",
238 srcs = [
239 "realtime.cc",
240 ],
241 hdrs = [
242 "realtime.h",
243 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800244 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700245 visibility = ["//visibility:public"],
246 deps = [
James Kuszmaula791b762023-07-13 14:56:21 -0700247 ":uuid",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700248 "@com_github_google_glog//:glog",
249 ],
250)
251
James Kuszmaulf01da392023-12-14 11:22:14 -0800252static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700253 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700254 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800255 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700256 visibility = ["//visibility:public"],
James Kuszmaul1e57af92023-12-20 15:34:54 -0800257 deps = ["//aos/flatbuffers/reflection:reflection_fbs"],
Austin Schuhcb108412019-10-13 16:09:54 -0700258)
259
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700260cc_static_flatbuffer(
261 name = "configuration_schema",
262 function = "aos::ConfigurationSchema",
263 target = ":configuration_fbs_reflection_out",
264 visibility = ["//visibility:public"],
265)
266
Alex Perryd5e13572020-02-22 15:15:08 -0800267flatbuffer_ts_library(
268 name = "configuration_ts_fbs",
269 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800270 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800271 visibility = ["//visibility:public"],
272)
273
Brian Silverman28760272020-02-02 13:21:51 -0800274flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800275 name = "configuration_fbs_python",
276 srcs = ["configuration.fbs"],
277 namespace = "aos",
278 tables = [
279 "Configuration",
280 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800281 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800282 "Map",
283 "Node",
284 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800285 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800286 visibility = ["//visibility:public"],
287)
288
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700289flatbuffer_rust_library(
290 name = "configuration_rust_fbs",
291 srcs = ["configuration.fbs"],
292 crate_name = "aos_configuration_fbs",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700293 visibility = ["//visibility:public"],
294)
295
John Park398c74a2018-10-20 21:17:39 -0700296cc_library(
297 name = "configuration",
298 srcs = [
299 "configuration.cc",
300 ],
301 hdrs = [
302 "configuration.h",
303 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800304 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800305 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700306 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700307 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700308 ":flatbuffer_merge",
309 ":flatbuffers",
310 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700311 "//aos:unique_malloc_ptr",
Austin Schuh83cbb1e2023-06-23 12:59:02 -0700312 "//aos/ipc_lib:index",
Austin Schuh217a9782019-12-21 23:02:50 -0800313 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700314 "//aos/util:file",
315 "@com_github_google_glog//:glog",
316 "@com_google_absl//absl/container:btree",
317 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700318 ],
John Park398c74a2018-10-20 21:17:39 -0700319)
320
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700321cc_library(
322 name = "configuration_for_rust",
323 srcs = [
324 "configuration_for_rust.cc",
325 ],
326 hdrs = [
327 "configuration_for_rust.h",
328 ],
329 deps = [
330 ":configuration",
331 ":for_rust",
Adam Snaider770b97b2023-08-04 21:07:48 -0700332 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700333 ],
334)
335
336autocxx_library(
337 name = "configuration_rs",
338 srcs = ["configuration.rs"],
339 crate_name = "aos_configuration",
340 libs = [
341 ":configuration",
342 ":configuration_for_rust",
343 ":configuration_fbs",
344 ],
345 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800346 test_data = [
347 "//aos/testdata:test_configs",
348 ],
James Kuszmaul1cd3c2b2024-05-21 17:08:10 -0700349 test_deps = [
350 "//aos/testing:path_rs",
351 ],
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700352 visibility = ["//visibility:public"],
353 deps = [
354 ":configuration_rust_fbs",
355 ":flatbuffers_rs",
Adam Snaider770b97b2023-08-04 21:07:48 -0700356 "@crate_index//:thiserror",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700357 ],
358)
359
James Kuszmaulabb77132020-08-01 19:56:16 -0700360flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800361 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700362 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800363 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700364 visibility = ["//aos:__subpackages__"],
365)
366
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700367flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800368 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700369 srcs = ["json_to_flatbuffer.fbs"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800370 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800371 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700372 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700373)
374
Brian Silvermand1805b62022-07-20 20:47:05 -0700375flatbuffer_rust_library(
376 name = "json_to_flatbuffer_rust_fbs",
377 srcs = ["json_to_flatbuffer.fbs"],
378 crate_name = "aos_json_to_flatbuffer_fbs",
Brian Silvermand1805b62022-07-20 20:47:05 -0700379 visibility = ["//aos:__subpackages__"],
380)
381
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700382cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700383 name = "flatbuffer_utils",
384 srcs = ["flatbuffer_utils.cc"],
385 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800386 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700387 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700388 deps = [
389 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800390 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700391 ],
392)
393
394cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700395 name = "json_tokenizer",
396 srcs = ["json_tokenizer.cc"],
397 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800398 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700399 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700400 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700401 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700402 "@com_google_absl//absl/strings",
403 ],
404)
405
406cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700407 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800408 srcs = [
409 "flatbuffer_introspection.cc",
410 "json_to_flatbuffer.cc",
411 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700412 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800413 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700414 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700415 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700416 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700417 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700418 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700419 ":json_tokenizer",
James Kuszmaulf5eb4682023-09-22 17:16:59 -0700420 "//aos/flatbuffers:builder",
Austin Schuhbba10282021-03-20 22:03:28 -0700421 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700422 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700423 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700424 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700425 ],
426)
427
428cc_test(
429 name = "json_to_flatbuffer_test",
430 srcs = [
431 "json_to_flatbuffer_test.cc",
432 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800433 data = [
434 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800435 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800436 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800437 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700438 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800439 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700440 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800441 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700442 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700443 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700444 ],
445)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700446
Tyler Chatow5e369a42019-11-23 11:57:31 -0800447cc_test(
448 name = "flatbuffer_introspection_test",
449 srcs = [
450 "flatbuffer_introspection_test.cc",
451 ],
452 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800453 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800454 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800455 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800456 deps = [
457 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800458 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800459 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700460 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800461 "//aos/util:file",
462 "@com_github_google_flatbuffers//:flatbuffers",
463 ],
464)
465
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700466cc_library(
467 name = "flatbuffer_merge",
468 srcs = ["flatbuffer_merge.cc"],
469 hdrs = ["flatbuffer_merge.h"],
470 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800471 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700472 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700473 deps = [
474 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700475 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700476 "@com_github_google_flatbuffers//:flatbuffers",
477 ],
478)
479
480cc_test(
481 name = "flatbuffer_merge_test",
482 srcs = [
483 "flatbuffer_merge_test.cc",
484 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800485 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700486 deps = [
487 ":flatbuffer_merge",
488 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800489 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700490 "//aos/testing:googletest",
491 ],
492)
Austin Schuhe93d8642019-10-13 15:27:07 -0700493
494cc_library(
495 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700496 srcs = [
497 "flatbuffers.cc",
498 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700499 hdrs = [
500 "flatbuffers.h",
501 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800502 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700503 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700504 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800505 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700506 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700507 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700508 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700509 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700510 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800511 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700512 ],
513)
Austin Schuhcb108412019-10-13 16:09:54 -0700514
Brian Silvermand1805b62022-07-20 20:47:05 -0700515rust_library(
516 name = "flatbuffers_rs",
517 srcs = ["flatbuffers.rs"],
518 crate_name = "aos_flatbuffers",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800519 test_deps = [
520 ":json_to_flatbuffer_rust_fbs",
521 ],
Brian Silvermand1805b62022-07-20 20:47:05 -0700522 visibility = ["//visibility:public"],
523 deps = [
524 "@com_github_google_flatbuffers//rust",
525 ],
526)
527
Austin Schuhcb108412019-10-13 16:09:54 -0700528cc_test(
529 name = "configuration_test",
530 srcs = [
531 "configuration_test.cc",
532 ],
533 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700534 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700535 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700536 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700537 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700538 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800539 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700540 deps = [
541 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700542 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800543 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700544 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700545 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700546 "//aos/testing:test_logging",
547 ],
548)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700549
550cc_binary(
551 name = "config_flattener",
552 srcs = [
553 "config_flattener.cc",
554 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800555 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700556 visibility = ["//visibility:public"],
557 deps = [
558 ":configuration",
559 ":init",
560 "//aos/util:file",
561 "@com_github_google_glog//:glog",
562 ],
563)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800564
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800565cc_library(
566 name = "aos_cli_utils",
567 srcs = [
568 "aos_cli_utils.cc",
569 ],
570 hdrs = [
571 "aos_cli_utils.h",
572 ],
573 target_compatible_with = ["@platforms//os:linux"],
574 visibility = ["//visibility:public"],
575 deps = [
576 ":configuration",
577 "//aos:init",
578 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700579 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800580 "@com_github_google_glog//:glog",
581 ],
582)
583
Tyler Chatow5e369a42019-11-23 11:57:31 -0800584cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800585 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800586 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800587 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800588 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800589 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800590 visibility = ["//visibility:public"],
591 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800592 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800593 ":configuration",
594 ":json_to_flatbuffer",
595 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800596 "@com_github_google_glog//:glog",
597 ],
598)
599
600cc_binary(
Austin Schuh99004602024-03-16 11:59:24 -0700601 name = "aos_jitter",
602 srcs = [
603 "aos_jitter.cc",
604 ],
605 target_compatible_with = ["@platforms//os:linux"],
606 visibility = ["//visibility:public"],
607 deps = [
608 ":aos_cli_utils",
609 ":configuration",
610 ":init",
611 ":json_to_flatbuffer",
612 ":realtime",
613 "@com_github_google_glog//:glog",
614 ],
615)
616
617cc_binary(
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800618 name = "aos_send",
619 srcs = [
620 "aos_send.cc",
621 ],
622 target_compatible_with = ["@platforms//os:linux"],
623 visibility = ["//visibility:public"],
624 deps = [
625 ":aos_cli_utils",
626 ":configuration",
627 ":init",
628 ":json_to_flatbuffer",
629 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800630 "@com_github_google_glog//:glog",
631 ],
632)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500633
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700634cc_binary(
635 name = "aos_graph_nodes",
636 srcs = [
637 "aos_graph_nodes.cc",
638 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800639 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700640 visibility = ["//visibility:public"],
641 deps = [
642 ":configuration",
643 ":json_to_flatbuffer",
644 "//aos:init",
645 "//aos/events:shm_event_loop",
646 "@com_github_google_glog//:glog",
647 ],
648)
649
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500650cc_library(
651 name = "ftrace",
652 srcs = [
653 "ftrace.cc",
654 ],
655 hdrs = [
656 "ftrace.h",
657 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800658 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500659 visibility = ["//visibility:public"],
660 deps = [
661 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800662 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500663 ],
664)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700665
666cc_library(
667 name = "fast_string_builder",
668 srcs = [
669 "fast_string_builder.cc",
670 ],
671 hdrs = [
672 "fast_string_builder.h",
673 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800674 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700675 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700676 deps = [
677 "@com_github_google_glog//:glog",
678 "@com_google_absl//absl/strings",
679 "@com_google_absl//absl/strings:str_format",
680 ],
681)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700682
Austin Schuhcc6070c2020-10-10 20:25:56 -0700683cc_test(
684 name = "realtime_test",
685 srcs = [
686 "realtime_test.cc",
687 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800688 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700689 visibility = ["//visibility:public"],
690 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700691 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700692 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700693 "@com_github_gflags_gflags//:gflags",
694 "@com_github_google_glog//:glog",
695 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700696 ],
697)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800698
699cc_test(
700 name = "flatbuffers_test",
701 srcs = [
702 "flatbuffers_test.cc",
703 ],
704 deps = [
705 ":flatbuffers",
706 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800707 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800708 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700709 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800710 ],
711)
Austin Schuh0de30f32020-12-06 12:44:28 -0800712
713py_binary(
714 name = "flatbuffers_static",
715 srcs = ["flatbuffers_static.py"],
716 visibility = ["//visibility:public"],
717)
Austin Schuh4385b142021-03-14 21:31:13 -0700718
719cc_library(
720 name = "uuid",
721 srcs = ["uuid.cc"],
722 hdrs = ["uuid.h"],
723 target_compatible_with = ["@platforms//os:linux"],
724 visibility = ["//visibility:public"],
725 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700726 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700727 "@com_github_google_flatbuffers//:flatbuffers",
728 "@com_github_google_glog//:glog",
729 "@com_google_absl//absl/types:span",
730 ],
731)
732
733cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700734 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700735 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700736 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700737 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700738 target_compatible_with = ["@platforms//os:linux"],
739 deps = [
740 ":uuid",
741 "//aos/testing:googletest",
742 ],
743)
744
745cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700746 name = "uuid_test",
747 srcs = ["uuid_test.cc"],
748 target_compatible_with = ["@platforms//os:linux"],
749 deps = [
750 ":uuid",
751 "//aos/testing:googletest",
752 ],
753)
Austin Schuh30f74292021-08-13 17:25:26 -0700754
Brian Silverman10599932022-08-15 06:05:53 -0700755cc_library(
756 name = "uuid_for_rust",
757 hdrs = ["uuid_for_rust.h"],
758 deps = [
759 ":uuid",
760 ],
761)
762
763autocxx_library(
764 name = "uuid_rs",
765 srcs = ["uuid.rs"],
766 crate_name = "aos_uuid",
767 libs = [
768 ":uuid",
769 ":uuid_for_rust",
770 ],
771 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
772 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700773 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700774 ],
Brian Silverman10599932022-08-15 06:05:53 -0700775 visibility = ["//visibility:public"],
776)
777
Austin Schuh30f74292021-08-13 17:25:26 -0700778cc_binary(
779 name = "aos_graph_channels",
780 srcs = [
781 "aos_graph_channels.cc",
782 ],
783 target_compatible_with = ["@platforms//os:linux"],
784 deps = [
785 "//aos:configuration",
786 "//aos:init",
787 "//aos:json_to_flatbuffer",
788 "//aos/events:simulated_event_loop",
789 "//aos/events/logging:log_reader",
790 "//aos/time",
791 "@com_github_gflags_gflags//:gflags",
792 "@com_github_google_glog//:glog",
793 ],
794)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700795
796cc_library(
797 name = "for_rust",
798 hdrs = [
799 "for_rust.h",
800 ],
801 visibility = ["//visibility:public"],
802 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700803 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700804 ],
805)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700806
807cc_library(
808 name = "sha256",
809 srcs = [
810 "sha256.cc",
811 ],
812 hdrs = ["sha256.h"],
813 target_compatible_with = ["@platforms//os:linux"],
814 visibility = ["//visibility:public"],
815 deps = [
James Kuszmaul56802ab2023-08-23 15:18:34 -0700816 "//aos/util:file",
Austin Schuhb0e439d2023-05-15 10:55:40 -0700817 "@boringssl//:crypto",
818 "@com_google_absl//absl/types:span",
819 ],
820)
James Kuszmaul56802ab2023-08-23 15:18:34 -0700821
822cc_test(
823 name = "sha256_test",
824 srcs = ["sha256_test.cc"],
825 deps = [
826 ":sha256",
827 "//aos/testing:googletest",
828 "//aos/testing:tmpdir",
829 ],
830)
Adam Snaidercc622812023-11-07 17:59:27 -0800831
832rust_library(
833 name = "aos_rs",
834 srcs = ["aos.rs"],
835 crate_name = "aos",
836 visibility = ["//visibility:public"],
837 deps = [
838 ":configuration_rs",
839 ":flatbuffers_rs",
840 ":init_rs",
841 ":uuid_rs",
842 "//aos/events:event_loop_runtime",
843 "//aos/events:shm_event_loop_rs",
844 "//aos/events:simulated_event_loop_rs",
845 ],
846)