blob: a887edc31f747e156176a21dda676e53269a9a87 [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",
228 libs = [
229 "//aos/testing:tmpdir",
230 ],
231 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700232 visibility = ["//visibility:public"],
233 deps = [
234 ":init_rs",
235 ],
236)
237
Alex Perrycb7da4b2019-08-28 19:35:56 -0700238cc_library(
239 name = "realtime",
240 srcs = [
241 "realtime.cc",
242 ],
243 hdrs = [
244 "realtime.h",
245 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800246 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700247 visibility = ["//visibility:public"],
248 deps = [
James Kuszmaula791b762023-07-13 14:56:21 -0700249 ":uuid",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700250 "@com_github_google_glog//:glog",
251 ],
252)
253
James Kuszmaulf01da392023-12-14 11:22:14 -0800254static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700255 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700256 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800257 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700258 visibility = ["//visibility:public"],
James Kuszmaul1e57af92023-12-20 15:34:54 -0800259 deps = ["//aos/flatbuffers/reflection:reflection_fbs"],
Austin Schuhcb108412019-10-13 16:09:54 -0700260)
261
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700262cc_static_flatbuffer(
263 name = "configuration_schema",
264 function = "aos::ConfigurationSchema",
265 target = ":configuration_fbs_reflection_out",
266 visibility = ["//visibility:public"],
267)
268
Alex Perryd5e13572020-02-22 15:15:08 -0800269flatbuffer_ts_library(
270 name = "configuration_ts_fbs",
271 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800272 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800273 visibility = ["//visibility:public"],
274)
275
Brian Silverman28760272020-02-02 13:21:51 -0800276flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800277 name = "configuration_fbs_python",
278 srcs = ["configuration.fbs"],
279 namespace = "aos",
280 tables = [
281 "Configuration",
282 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800283 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800284 "Map",
285 "Node",
286 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800287 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800288 visibility = ["//visibility:public"],
289)
290
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700291flatbuffer_rust_library(
292 name = "configuration_rust_fbs",
293 srcs = ["configuration.fbs"],
294 crate_name = "aos_configuration_fbs",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700295 visibility = ["//visibility:public"],
296)
297
John Park398c74a2018-10-20 21:17:39 -0700298cc_library(
299 name = "configuration",
300 srcs = [
301 "configuration.cc",
302 ],
303 hdrs = [
304 "configuration.h",
305 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800306 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800307 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700308 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700309 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700310 ":flatbuffer_merge",
311 ":flatbuffers",
312 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700313 "//aos:unique_malloc_ptr",
Austin Schuh83cbb1e2023-06-23 12:59:02 -0700314 "//aos/ipc_lib:index",
Austin Schuh217a9782019-12-21 23:02:50 -0800315 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700316 "//aos/util:file",
317 "@com_github_google_glog//:glog",
318 "@com_google_absl//absl/container:btree",
319 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700320 ],
John Park398c74a2018-10-20 21:17:39 -0700321)
322
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700323cc_library(
324 name = "configuration_for_rust",
325 srcs = [
326 "configuration_for_rust.cc",
327 ],
328 hdrs = [
329 "configuration_for_rust.h",
330 ],
331 deps = [
332 ":configuration",
333 ":for_rust",
Adam Snaider770b97b2023-08-04 21:07:48 -0700334 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700335 ],
336)
337
338autocxx_library(
339 name = "configuration_rs",
340 srcs = ["configuration.rs"],
341 crate_name = "aos_configuration",
342 libs = [
343 ":configuration",
344 ":configuration_for_rust",
345 ":configuration_fbs",
346 ],
347 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700348 visibility = ["//visibility:public"],
349 deps = [
350 ":configuration_rust_fbs",
351 ":flatbuffers_rs",
Adam Snaider770b97b2023-08-04 21:07:48 -0700352 "@crate_index//:thiserror",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700353 ],
354)
355
356rust_test(
357 name = "configuration_rs_test",
358 crate = ":configuration_rs",
359 data = [
360 "//aos/testdata:test_configs",
361 ],
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700362)
363
James Kuszmaulabb77132020-08-01 19:56:16 -0700364flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800365 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700366 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800367 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700368 visibility = ["//aos:__subpackages__"],
369)
370
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700371flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800372 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700373 srcs = ["json_to_flatbuffer.fbs"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800374 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800375 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700376 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700377)
378
Brian Silvermand1805b62022-07-20 20:47:05 -0700379flatbuffer_rust_library(
380 name = "json_to_flatbuffer_rust_fbs",
381 srcs = ["json_to_flatbuffer.fbs"],
382 crate_name = "aos_json_to_flatbuffer_fbs",
Brian Silvermand1805b62022-07-20 20:47:05 -0700383 visibility = ["//aos:__subpackages__"],
384)
385
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700386cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700387 name = "flatbuffer_utils",
388 srcs = ["flatbuffer_utils.cc"],
389 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800390 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700391 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700392 deps = [
393 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800394 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700395 ],
396)
397
398cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700399 name = "json_tokenizer",
400 srcs = ["json_tokenizer.cc"],
401 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800402 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700403 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700404 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700405 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700406 "@com_google_absl//absl/strings",
407 ],
408)
409
410cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700411 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800412 srcs = [
413 "flatbuffer_introspection.cc",
414 "json_to_flatbuffer.cc",
415 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700416 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800417 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700418 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700419 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700420 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700421 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700422 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700423 ":json_tokenizer",
James Kuszmaulf5eb4682023-09-22 17:16:59 -0700424 "//aos/flatbuffers:builder",
Austin Schuhbba10282021-03-20 22:03:28 -0700425 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700426 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700427 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700428 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700429 ],
430)
431
432cc_test(
433 name = "json_to_flatbuffer_test",
434 srcs = [
435 "json_to_flatbuffer_test.cc",
436 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800437 data = [
438 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800439 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800440 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800441 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700442 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800443 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700444 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800445 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700446 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700447 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700448 ],
449)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700450
Tyler Chatow5e369a42019-11-23 11:57:31 -0800451cc_test(
452 name = "flatbuffer_introspection_test",
453 srcs = [
454 "flatbuffer_introspection_test.cc",
455 ],
456 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800457 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800458 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800459 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800460 deps = [
461 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800462 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800463 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700464 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800465 "//aos/util:file",
466 "@com_github_google_flatbuffers//:flatbuffers",
467 ],
468)
469
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700470cc_library(
471 name = "flatbuffer_merge",
472 srcs = ["flatbuffer_merge.cc"],
473 hdrs = ["flatbuffer_merge.h"],
474 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800475 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700476 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700477 deps = [
478 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700479 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700480 "@com_github_google_flatbuffers//:flatbuffers",
481 ],
482)
483
484cc_test(
485 name = "flatbuffer_merge_test",
486 srcs = [
487 "flatbuffer_merge_test.cc",
488 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800489 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700490 deps = [
491 ":flatbuffer_merge",
492 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800493 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700494 "//aos/testing:googletest",
495 ],
496)
Austin Schuhe93d8642019-10-13 15:27:07 -0700497
498cc_library(
499 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700500 srcs = [
501 "flatbuffers.cc",
502 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700503 hdrs = [
504 "flatbuffers.h",
505 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800506 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700507 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700508 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800509 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700510 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700511 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700512 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700513 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700514 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800515 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700516 ],
517)
Austin Schuhcb108412019-10-13 16:09:54 -0700518
Brian Silvermand1805b62022-07-20 20:47:05 -0700519rust_library(
520 name = "flatbuffers_rs",
521 srcs = ["flatbuffers.rs"],
522 crate_name = "aos_flatbuffers",
Brian Silvermand1805b62022-07-20 20:47:05 -0700523 visibility = ["//visibility:public"],
524 deps = [
525 "@com_github_google_flatbuffers//rust",
526 ],
527)
528
529rust_test(
530 name = "flatbuffers_rs_test",
531 crate = ":flatbuffers_rs",
532 deps = [
533 ":json_to_flatbuffer_rust_fbs",
534 ],
535)
536
Austin Schuhcb108412019-10-13 16:09:54 -0700537cc_test(
538 name = "configuration_test",
539 srcs = [
540 "configuration_test.cc",
541 ],
542 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700543 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700544 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700545 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700546 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700547 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800548 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700549 deps = [
550 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700551 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800552 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700553 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700554 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700555 "//aos/testing:test_logging",
556 ],
557)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700558
559cc_binary(
560 name = "config_flattener",
561 srcs = [
562 "config_flattener.cc",
563 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800564 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700565 visibility = ["//visibility:public"],
566 deps = [
567 ":configuration",
568 ":init",
569 "//aos/util:file",
570 "@com_github_google_glog//:glog",
571 ],
572)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800573
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800574cc_library(
575 name = "aos_cli_utils",
576 srcs = [
577 "aos_cli_utils.cc",
578 ],
579 hdrs = [
580 "aos_cli_utils.h",
581 ],
582 target_compatible_with = ["@platforms//os:linux"],
583 visibility = ["//visibility:public"],
584 deps = [
585 ":configuration",
586 "//aos:init",
587 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700588 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800589 "@com_github_google_glog//:glog",
590 ],
591)
592
Tyler Chatow5e369a42019-11-23 11:57:31 -0800593cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800594 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800595 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800596 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800597 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800598 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800599 visibility = ["//visibility:public"],
600 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800601 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800602 ":configuration",
603 ":json_to_flatbuffer",
604 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800605 "@com_github_google_glog//:glog",
606 ],
607)
608
609cc_binary(
610 name = "aos_send",
611 srcs = [
612 "aos_send.cc",
613 ],
614 target_compatible_with = ["@platforms//os:linux"],
615 visibility = ["//visibility:public"],
616 deps = [
617 ":aos_cli_utils",
618 ":configuration",
619 ":init",
620 ":json_to_flatbuffer",
621 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800622 "@com_github_google_glog//:glog",
623 ],
624)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500625
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700626cc_binary(
627 name = "aos_graph_nodes",
628 srcs = [
629 "aos_graph_nodes.cc",
630 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800631 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700632 visibility = ["//visibility:public"],
633 deps = [
634 ":configuration",
635 ":json_to_flatbuffer",
636 "//aos:init",
637 "//aos/events:shm_event_loop",
638 "@com_github_google_glog//:glog",
639 ],
640)
641
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500642cc_library(
643 name = "ftrace",
644 srcs = [
645 "ftrace.cc",
646 ],
647 hdrs = [
648 "ftrace.h",
649 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800650 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500651 visibility = ["//visibility:public"],
652 deps = [
653 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800654 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500655 ],
656)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700657
658cc_library(
659 name = "fast_string_builder",
660 srcs = [
661 "fast_string_builder.cc",
662 ],
663 hdrs = [
664 "fast_string_builder.h",
665 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800666 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700667 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700668 deps = [
669 "@com_github_google_glog//:glog",
670 "@com_google_absl//absl/strings",
671 "@com_google_absl//absl/strings:str_format",
672 ],
673)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700674
Austin Schuhcc6070c2020-10-10 20:25:56 -0700675cc_test(
676 name = "realtime_test",
677 srcs = [
678 "realtime_test.cc",
679 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800680 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700681 visibility = ["//visibility:public"],
682 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700683 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700684 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700685 "@com_github_gflags_gflags//:gflags",
686 "@com_github_google_glog//:glog",
687 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700688 ],
689)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800690
691cc_test(
692 name = "flatbuffers_test",
693 srcs = [
694 "flatbuffers_test.cc",
695 ],
696 deps = [
697 ":flatbuffers",
698 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800699 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800700 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700701 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800702 ],
703)
Austin Schuh0de30f32020-12-06 12:44:28 -0800704
705py_binary(
706 name = "flatbuffers_static",
707 srcs = ["flatbuffers_static.py"],
708 visibility = ["//visibility:public"],
709)
Austin Schuh4385b142021-03-14 21:31:13 -0700710
711cc_library(
712 name = "uuid",
713 srcs = ["uuid.cc"],
714 hdrs = ["uuid.h"],
715 target_compatible_with = ["@platforms//os:linux"],
716 visibility = ["//visibility:public"],
717 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700718 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700719 "@com_github_google_flatbuffers//:flatbuffers",
720 "@com_github_google_glog//:glog",
721 "@com_google_absl//absl/types:span",
722 ],
723)
724
725cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700726 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700727 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700728 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700729 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700730 target_compatible_with = ["@platforms//os:linux"],
731 deps = [
732 ":uuid",
733 "//aos/testing:googletest",
734 ],
735)
736
737cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700738 name = "uuid_test",
739 srcs = ["uuid_test.cc"],
740 target_compatible_with = ["@platforms//os:linux"],
741 deps = [
742 ":uuid",
743 "//aos/testing:googletest",
744 ],
745)
Austin Schuh30f74292021-08-13 17:25:26 -0700746
Brian Silverman10599932022-08-15 06:05:53 -0700747cc_library(
748 name = "uuid_for_rust",
749 hdrs = ["uuid_for_rust.h"],
750 deps = [
751 ":uuid",
752 ],
753)
754
755autocxx_library(
756 name = "uuid_rs",
757 srcs = ["uuid.rs"],
758 crate_name = "aos_uuid",
759 libs = [
760 ":uuid",
761 ":uuid_for_rust",
762 ],
763 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
764 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700765 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700766 ],
Brian Silverman10599932022-08-15 06:05:53 -0700767 visibility = ["//visibility:public"],
768)
769
Austin Schuh30f74292021-08-13 17:25:26 -0700770cc_binary(
771 name = "aos_graph_channels",
772 srcs = [
773 "aos_graph_channels.cc",
774 ],
775 target_compatible_with = ["@platforms//os:linux"],
776 deps = [
777 "//aos:configuration",
778 "//aos:init",
779 "//aos:json_to_flatbuffer",
780 "//aos/events:simulated_event_loop",
781 "//aos/events/logging:log_reader",
782 "//aos/time",
783 "@com_github_gflags_gflags//:gflags",
784 "@com_github_google_glog//:glog",
785 ],
786)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700787
788cc_library(
789 name = "for_rust",
790 hdrs = [
791 "for_rust.h",
792 ],
793 visibility = ["//visibility:public"],
794 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700795 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700796 ],
797)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700798
799cc_library(
800 name = "sha256",
801 srcs = [
802 "sha256.cc",
803 ],
804 hdrs = ["sha256.h"],
805 target_compatible_with = ["@platforms//os:linux"],
806 visibility = ["//visibility:public"],
807 deps = [
James Kuszmaul56802ab2023-08-23 15:18:34 -0700808 "//aos/util:file",
Austin Schuhb0e439d2023-05-15 10:55:40 -0700809 "@boringssl//:crypto",
810 "@com_google_absl//absl/types:span",
811 ],
812)
James Kuszmaul56802ab2023-08-23 15:18:34 -0700813
814cc_test(
815 name = "sha256_test",
816 srcs = ["sha256_test.cc"],
817 deps = [
818 ":sha256",
819 "//aos/testing:googletest",
820 "//aos/testing:tmpdir",
821 ],
822)