blob: e67b593e176f434f0192db5b8b141270aaa4f3da [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 ],
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
James Kuszmaulabb77132020-08-01 19:56:16 -0700357flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800358 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700359 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800360 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700361 visibility = ["//aos:__subpackages__"],
362)
363
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700364flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800365 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700366 srcs = ["json_to_flatbuffer.fbs"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800367 gen_reflections = True,
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__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700370)
371
Brian Silvermand1805b62022-07-20 20:47:05 -0700372flatbuffer_rust_library(
373 name = "json_to_flatbuffer_rust_fbs",
374 srcs = ["json_to_flatbuffer.fbs"],
375 crate_name = "aos_json_to_flatbuffer_fbs",
Brian Silvermand1805b62022-07-20 20:47:05 -0700376 visibility = ["//aos:__subpackages__"],
377)
378
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700379cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700380 name = "flatbuffer_utils",
381 srcs = ["flatbuffer_utils.cc"],
382 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800383 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700384 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700385 deps = [
386 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800387 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700388 ],
389)
390
391cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700392 name = "json_tokenizer",
393 srcs = ["json_tokenizer.cc"],
394 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800395 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700396 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700397 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700398 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700399 "@com_google_absl//absl/strings",
400 ],
401)
402
403cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700404 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800405 srcs = [
406 "flatbuffer_introspection.cc",
407 "json_to_flatbuffer.cc",
408 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700409 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800410 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700411 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700412 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700413 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700414 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700415 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700416 ":json_tokenizer",
James Kuszmaulf5eb4682023-09-22 17:16:59 -0700417 "//aos/flatbuffers:builder",
Austin Schuhbba10282021-03-20 22:03:28 -0700418 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700419 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700420 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700421 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700422 ],
423)
424
425cc_test(
426 name = "json_to_flatbuffer_test",
427 srcs = [
428 "json_to_flatbuffer_test.cc",
429 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800430 data = [
431 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800432 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800433 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800434 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700435 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800436 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700437 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800438 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700439 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700440 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700441 ],
442)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700443
Tyler Chatow5e369a42019-11-23 11:57:31 -0800444cc_test(
445 name = "flatbuffer_introspection_test",
446 srcs = [
447 "flatbuffer_introspection_test.cc",
448 ],
449 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800450 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800451 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800452 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800453 deps = [
454 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800455 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800456 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700457 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800458 "//aos/util:file",
459 "@com_github_google_flatbuffers//:flatbuffers",
460 ],
461)
462
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700463cc_library(
464 name = "flatbuffer_merge",
465 srcs = ["flatbuffer_merge.cc"],
466 hdrs = ["flatbuffer_merge.h"],
467 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800468 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700469 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700470 deps = [
471 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700472 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700473 "@com_github_google_flatbuffers//:flatbuffers",
474 ],
475)
476
477cc_test(
478 name = "flatbuffer_merge_test",
479 srcs = [
480 "flatbuffer_merge_test.cc",
481 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800482 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700483 deps = [
484 ":flatbuffer_merge",
485 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800486 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700487 "//aos/testing:googletest",
488 ],
489)
Austin Schuhe93d8642019-10-13 15:27:07 -0700490
491cc_library(
492 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700493 srcs = [
494 "flatbuffers.cc",
495 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700496 hdrs = [
497 "flatbuffers.h",
498 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800499 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700500 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700501 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800502 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700503 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700504 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700505 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700506 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700507 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800508 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700509 ],
510)
Austin Schuhcb108412019-10-13 16:09:54 -0700511
Brian Silvermand1805b62022-07-20 20:47:05 -0700512rust_library(
513 name = "flatbuffers_rs",
514 srcs = ["flatbuffers.rs"],
515 crate_name = "aos_flatbuffers",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800516 test_deps = [
517 ":json_to_flatbuffer_rust_fbs",
518 ],
Brian Silvermand1805b62022-07-20 20:47:05 -0700519 visibility = ["//visibility:public"],
520 deps = [
521 "@com_github_google_flatbuffers//rust",
522 ],
523)
524
Austin Schuhcb108412019-10-13 16:09:54 -0700525cc_test(
526 name = "configuration_test",
527 srcs = [
528 "configuration_test.cc",
529 ],
530 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700531 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700532 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700533 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700534 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700535 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800536 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700537 deps = [
538 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700539 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800540 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700541 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700542 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700543 "//aos/testing:test_logging",
544 ],
545)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700546
547cc_binary(
548 name = "config_flattener",
549 srcs = [
550 "config_flattener.cc",
551 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800552 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700553 visibility = ["//visibility:public"],
554 deps = [
555 ":configuration",
556 ":init",
557 "//aos/util:file",
558 "@com_github_google_glog//:glog",
559 ],
560)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800561
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800562cc_library(
563 name = "aos_cli_utils",
564 srcs = [
565 "aos_cli_utils.cc",
566 ],
567 hdrs = [
568 "aos_cli_utils.h",
569 ],
570 target_compatible_with = ["@platforms//os:linux"],
571 visibility = ["//visibility:public"],
572 deps = [
573 ":configuration",
574 "//aos:init",
575 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700576 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800577 "@com_github_google_glog//:glog",
578 ],
579)
580
Tyler Chatow5e369a42019-11-23 11:57:31 -0800581cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800582 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800583 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800584 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800585 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800586 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800587 visibility = ["//visibility:public"],
588 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800589 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800590 ":configuration",
591 ":json_to_flatbuffer",
592 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800593 "@com_github_google_glog//:glog",
594 ],
595)
596
597cc_binary(
Austin Schuh99004602024-03-16 11:59:24 -0700598 name = "aos_jitter",
599 srcs = [
600 "aos_jitter.cc",
601 ],
602 target_compatible_with = ["@platforms//os:linux"],
603 visibility = ["//visibility:public"],
604 deps = [
605 ":aos_cli_utils",
606 ":configuration",
607 ":init",
608 ":json_to_flatbuffer",
609 ":realtime",
610 "@com_github_google_glog//:glog",
611 ],
612)
613
614cc_binary(
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800615 name = "aos_send",
616 srcs = [
617 "aos_send.cc",
618 ],
619 target_compatible_with = ["@platforms//os:linux"],
620 visibility = ["//visibility:public"],
621 deps = [
622 ":aos_cli_utils",
623 ":configuration",
624 ":init",
625 ":json_to_flatbuffer",
626 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800627 "@com_github_google_glog//:glog",
628 ],
629)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500630
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700631cc_binary(
632 name = "aos_graph_nodes",
633 srcs = [
634 "aos_graph_nodes.cc",
635 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800636 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700637 visibility = ["//visibility:public"],
638 deps = [
639 ":configuration",
640 ":json_to_flatbuffer",
641 "//aos:init",
642 "//aos/events:shm_event_loop",
643 "@com_github_google_glog//:glog",
644 ],
645)
646
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500647cc_library(
648 name = "ftrace",
649 srcs = [
650 "ftrace.cc",
651 ],
652 hdrs = [
653 "ftrace.h",
654 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800655 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500656 visibility = ["//visibility:public"],
657 deps = [
658 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800659 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500660 ],
661)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700662
663cc_library(
664 name = "fast_string_builder",
665 srcs = [
666 "fast_string_builder.cc",
667 ],
668 hdrs = [
669 "fast_string_builder.h",
670 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800671 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700672 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700673 deps = [
674 "@com_github_google_glog//:glog",
675 "@com_google_absl//absl/strings",
676 "@com_google_absl//absl/strings:str_format",
677 ],
678)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700679
Austin Schuhcc6070c2020-10-10 20:25:56 -0700680cc_test(
681 name = "realtime_test",
682 srcs = [
683 "realtime_test.cc",
684 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800685 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700686 visibility = ["//visibility:public"],
687 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700688 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700689 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700690 "@com_github_gflags_gflags//:gflags",
691 "@com_github_google_glog//:glog",
692 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700693 ],
694)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800695
696cc_test(
697 name = "flatbuffers_test",
698 srcs = [
699 "flatbuffers_test.cc",
700 ],
701 deps = [
702 ":flatbuffers",
703 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800704 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800705 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700706 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800707 ],
708)
Austin Schuh0de30f32020-12-06 12:44:28 -0800709
710py_binary(
711 name = "flatbuffers_static",
712 srcs = ["flatbuffers_static.py"],
713 visibility = ["//visibility:public"],
714)
Austin Schuh4385b142021-03-14 21:31:13 -0700715
716cc_library(
717 name = "uuid",
718 srcs = ["uuid.cc"],
719 hdrs = ["uuid.h"],
720 target_compatible_with = ["@platforms//os:linux"],
721 visibility = ["//visibility:public"],
722 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700723 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700724 "@com_github_google_flatbuffers//:flatbuffers",
725 "@com_github_google_glog//:glog",
726 "@com_google_absl//absl/types:span",
727 ],
728)
729
730cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700731 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700732 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700733 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700734 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700735 target_compatible_with = ["@platforms//os:linux"],
736 deps = [
737 ":uuid",
738 "//aos/testing:googletest",
739 ],
740)
741
742cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700743 name = "uuid_test",
744 srcs = ["uuid_test.cc"],
745 target_compatible_with = ["@platforms//os:linux"],
746 deps = [
747 ":uuid",
748 "//aos/testing:googletest",
749 ],
750)
Austin Schuh30f74292021-08-13 17:25:26 -0700751
Brian Silverman10599932022-08-15 06:05:53 -0700752cc_library(
753 name = "uuid_for_rust",
754 hdrs = ["uuid_for_rust.h"],
755 deps = [
756 ":uuid",
757 ],
758)
759
760autocxx_library(
761 name = "uuid_rs",
762 srcs = ["uuid.rs"],
763 crate_name = "aos_uuid",
764 libs = [
765 ":uuid",
766 ":uuid_for_rust",
767 ],
768 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
769 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700770 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700771 ],
Brian Silverman10599932022-08-15 06:05:53 -0700772 visibility = ["//visibility:public"],
773)
774
Austin Schuh30f74292021-08-13 17:25:26 -0700775cc_binary(
776 name = "aos_graph_channels",
777 srcs = [
778 "aos_graph_channels.cc",
779 ],
780 target_compatible_with = ["@platforms//os:linux"],
781 deps = [
782 "//aos:configuration",
783 "//aos:init",
784 "//aos:json_to_flatbuffer",
785 "//aos/events:simulated_event_loop",
786 "//aos/events/logging:log_reader",
787 "//aos/time",
788 "@com_github_gflags_gflags//:gflags",
789 "@com_github_google_glog//:glog",
790 ],
791)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700792
793cc_library(
794 name = "for_rust",
795 hdrs = [
796 "for_rust.h",
797 ],
798 visibility = ["//visibility:public"],
799 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700800 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700801 ],
802)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700803
804cc_library(
805 name = "sha256",
806 srcs = [
807 "sha256.cc",
808 ],
809 hdrs = ["sha256.h"],
810 target_compatible_with = ["@platforms//os:linux"],
811 visibility = ["//visibility:public"],
812 deps = [
James Kuszmaul56802ab2023-08-23 15:18:34 -0700813 "//aos/util:file",
Austin Schuhb0e439d2023-05-15 10:55:40 -0700814 "@boringssl//:crypto",
815 "@com_google_absl//absl/types:span",
816 ],
817)
James Kuszmaul56802ab2023-08-23 15:18:34 -0700818
819cc_test(
820 name = "sha256_test",
821 srcs = ["sha256_test.cc"],
822 deps = [
823 ":sha256",
824 "//aos/testing:googletest",
825 "//aos/testing:tmpdir",
826 ],
827)
Adam Snaidercc622812023-11-07 17:59:27 -0800828
829rust_library(
830 name = "aos_rs",
831 srcs = ["aos.rs"],
832 crate_name = "aos",
833 visibility = ["//visibility:public"],
834 deps = [
835 ":configuration_rs",
836 ":flatbuffers_rs",
837 ":init_rs",
838 ":uuid_rs",
839 "//aos/events:event_loop_runtime",
840 "//aos/events:shm_event_loop_rs",
841 "//aos/events:simulated_event_loop_rs",
842 ],
843)