blob: 164f40ba5d7c5bde411a1b96e5edeba03ddf3f62 [file] [log] [blame]
Austin Schuha1d006e2022-09-14 21:50:42 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library", "flatbuffer_rust_library")
2load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Brian Silvermand1805b62022-07-20 20:47:05 -07003load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
James Kuszmaule4aa01d2022-06-28 14:09:02 -07004load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
Brian Silverman7edd1ce2022-07-23 16:10:54 -07005load("//tools/build_rules:autocxx.bzl", "autocxx_library")
Austin Schuh972e47e2018-12-20 17:20:58 -08006
Austin Schuh00e302a2020-12-21 11:53:30 -08007exports_files(["aos_dump_autocomplete.sh"])
8
Brian Silverman258b9172015-09-19 14:32:57 -04009filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070010 name = "prime_binaries",
11 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080012 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070013 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080014 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080015 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070016 ],
17 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080018)
Austin Schuhc80dd152016-02-29 01:47:44 -080019
20filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070021 name = "prime_start_binaries",
22 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080023 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070024 ],
25 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080026)
Brian Silverman6470f442018-08-05 12:08:16 -070027
Austin Schuhc80dd152016-02-29 01:47:44 -080028filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070029 name = "prime_binaries_stripped",
30 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080031 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070032 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080033 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070034 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070035 ],
36 visibility = ["//visibility:public"],
37)
38
39filegroup(
40 name = "prime_start_binaries_stripped",
41 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080042 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070043 ],
44 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080045)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070046
47cc_library(
John Park33858a32018-09-28 23:05:48 -070048 name = "math",
49 hdrs = [
50 "commonmath.h",
51 ],
John Park33858a32018-09-28 23:05:48 -070052 visibility = ["//visibility:public"],
53)
54
Brian Silverman6470f442018-08-05 12:08:16 -070055py_library(
56 name = "python_init",
57 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080058 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070059 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070060)
John Park33858a32018-09-28 23:05:48 -070061
62cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080063 name = "macros",
64 hdrs = [
John Park33858a32018-09-28 23:05:48 -070065 "macros.h",
John Park33858a32018-09-28 23:05:48 -070066 ],
67 visibility = ["//visibility:public"],
68)
69
70cc_library(
71 name = "gtest_prod",
72 hdrs = [
73 "gtest_prod.h",
74 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070076 visibility = ["//visibility:public"],
77)
78
79cc_library(
John Park33858a32018-09-28 23:05:48 -070080 name = "unique_malloc_ptr",
81 hdrs = [
82 "unique_malloc_ptr.h",
83 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080084 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070085 visibility = ["//visibility:public"],
86)
87
88cc_library(
89 name = "condition",
90 srcs = [
91 "condition.cc",
92 ],
93 hdrs = [
94 "condition.h",
95 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080096 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070097 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -080098 deps = [
99 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -0800100 "//aos/mutex",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700101 "@com_github_google_glog//:glog",
Austin Schuh972e47e2018-12-20 17:20:58 -0800102 ],
John Park33858a32018-09-28 23:05:48 -0700103)
104
105cc_test(
106 name = "condition_test",
107 srcs = [
108 "condition_test.cc",
109 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800110 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700111 deps = [
112 ":condition",
113 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700114 "//aos/ipc_lib:aos_sync",
115 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800116 "//aos/logging",
117 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700118 "//aos/testing:googletest",
119 "//aos/testing:prevent_exit",
120 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800121 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700122 ],
123)
124
125cc_library(
126 name = "die",
127 srcs = [
128 "die.cc",
129 ],
130 hdrs = [
131 "die.h",
132 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800133 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800134 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700135 deps = [
136 "//aos:macros",
137 "//aos/libc:aos_strerror",
138 ],
John Park33858a32018-09-28 23:05:48 -0700139)
140
John Park33858a32018-09-28 23:05:48 -0700141cc_test(
142 name = "die_test",
143 srcs = [
144 "die_test.cc",
145 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800146 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700147 deps = [
148 ":die",
149 "//aos/testing:googletest",
150 ],
151)
152
John Park398c74a2018-10-20 21:17:39 -0700153cc_binary(
154 name = "dump_rtprio",
155 srcs = [
156 "dump_rtprio.cc",
157 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800158 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700159 deps = [
Austin Schuh972e47e2018-12-20 17:20:58 -0800160 "//aos/time",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700161 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700162 ],
163)
164
165cc_library(
John Park398c74a2018-10-20 21:17:39 -0700166 name = "init",
167 srcs = [
168 "init.cc",
169 ],
170 hdrs = [
171 "init.h",
172 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800173 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800174 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700175 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700176 ":realtime",
John Park398c74a2018-10-20 21:17:39 -0700177 "//aos:die",
Austin Schuh972e47e2018-12-20 17:20:58 -0800178 "//aos/logging:implementations",
John Park398c74a2018-10-20 21:17:39 -0700179 ],
John Park398c74a2018-10-20 21:17:39 -0700180)
181
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700182autocxx_library(
183 name = "init_rs",
184 srcs = ["init.rs"],
185 crate_name = "aos_init",
186 libs = [
187 ":init",
188 ],
189 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700190 target_compatible_with = select({
191 "//conditions:default": ["//tools/platforms/rust:has_support"],
192 "//tools:has_msan": ["@platforms//:incompatible"],
193 }),
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700194 visibility = ["//visibility:public"],
195)
196
Alex Perrycb7da4b2019-08-28 19:35:56 -0700197cc_library(
198 name = "realtime",
199 srcs = [
200 "realtime.cc",
201 ],
202 hdrs = [
203 "realtime.h",
204 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800205 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700206 visibility = ["//visibility:public"],
207 deps = [
Austin Schuhcc6070c2020-10-10 20:25:56 -0700208 ":thread_local",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700209 "@com_github_google_glog//:glog",
210 ],
211)
212
Austin Schuhcb108412019-10-13 16:09:54 -0700213flatbuffer_cc_library(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700214 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700215 srcs = ["configuration.fbs"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700216 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800217 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700218 visibility = ["//visibility:public"],
Austin Schuhcb108412019-10-13 16:09:54 -0700219)
220
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700221cc_static_flatbuffer(
222 name = "configuration_schema",
223 function = "aos::ConfigurationSchema",
224 target = ":configuration_fbs_reflection_out",
225 visibility = ["//visibility:public"],
226)
227
Alex Perryd5e13572020-02-22 15:15:08 -0800228flatbuffer_ts_library(
229 name = "configuration_ts_fbs",
230 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800231 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800232 visibility = ["//visibility:public"],
233)
234
Brian Silverman28760272020-02-02 13:21:51 -0800235flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800236 name = "configuration_fbs_python",
237 srcs = ["configuration.fbs"],
238 namespace = "aos",
239 tables = [
240 "Configuration",
241 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800242 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800243 "Map",
244 "Node",
245 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800246 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800247 visibility = ["//visibility:public"],
248)
249
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700250flatbuffer_rust_library(
251 name = "configuration_rust_fbs",
252 srcs = ["configuration.fbs"],
253 crate_name = "aos_configuration_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700254 target_compatible_with = select({
255 "//conditions:default": ["//tools/platforms/rust:has_support"],
256 "//tools:has_msan": ["@platforms//:incompatible"],
257 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700258 visibility = ["//visibility:public"],
259)
260
John Park398c74a2018-10-20 21:17:39 -0700261cc_library(
262 name = "configuration",
263 srcs = [
264 "configuration.cc",
265 ],
266 hdrs = [
267 "configuration.h",
268 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800269 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800270 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700271 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700272 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700273 ":flatbuffer_merge",
274 ":flatbuffers",
275 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700276 "//aos:unique_malloc_ptr",
Austin Schuh217a9782019-12-21 23:02:50 -0800277 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700278 "//aos/util:file",
279 "@com_github_google_glog//:glog",
280 "@com_google_absl//absl/container:btree",
281 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700282 ],
John Park398c74a2018-10-20 21:17:39 -0700283)
284
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700285cc_library(
286 name = "configuration_for_rust",
287 srcs = [
288 "configuration_for_rust.cc",
289 ],
290 hdrs = [
291 "configuration_for_rust.h",
292 ],
293 deps = [
294 ":configuration",
295 ":for_rust",
296 "//third_party/cargo:cxx_cc",
297 ],
298)
299
300autocxx_library(
301 name = "configuration_rs",
302 srcs = ["configuration.rs"],
303 crate_name = "aos_configuration",
304 libs = [
305 ":configuration",
306 ":configuration_for_rust",
307 ":configuration_fbs",
308 ],
309 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700310 target_compatible_with = select({
311 "//conditions:default": ["//tools/platforms/rust:has_support"],
312 "//tools:has_msan": ["@platforms//:incompatible"],
313 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700314 visibility = ["//visibility:public"],
315 deps = [
316 ":configuration_rust_fbs",
317 ":flatbuffers_rs",
318 "//third_party/cargo:thiserror",
319 ],
320)
321
322rust_test(
323 name = "configuration_rs_test",
324 crate = ":configuration_rs",
325 data = [
326 "//aos/testdata:test_configs",
327 ],
328 # TODO: Make Rust play happy with pic vs nopic. Details at:
329 # https://github.com/bazelbuild/rules_rust/issues/118
330 rustc_flags = ["-Crelocation-model=static"],
331)
332
James Kuszmaulabb77132020-08-01 19:56:16 -0700333flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800334 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700335 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800336 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700337 visibility = ["//aos:__subpackages__"],
338)
339
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700340flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800341 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700342 srcs = ["json_to_flatbuffer.fbs"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800343 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800344 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700345 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700346)
347
Brian Silvermand1805b62022-07-20 20:47:05 -0700348flatbuffer_rust_library(
349 name = "json_to_flatbuffer_rust_fbs",
350 srcs = ["json_to_flatbuffer.fbs"],
351 crate_name = "aos_json_to_flatbuffer_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700352 target_compatible_with = select({
353 "//conditions:default": ["//tools/platforms/rust:has_support"],
354 "//tools:has_msan": ["@platforms//:incompatible"],
355 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700356 visibility = ["//aos:__subpackages__"],
357)
358
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700359cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700360 name = "flatbuffer_utils",
361 srcs = ["flatbuffer_utils.cc"],
362 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800363 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700364 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700365 deps = [
366 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800367 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700368 ],
369)
370
371cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700372 name = "json_tokenizer",
373 srcs = ["json_tokenizer.cc"],
374 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800375 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700376 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700377 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700378 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700379 "@com_google_absl//absl/strings",
380 ],
381)
382
383cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700384 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800385 srcs = [
386 "flatbuffer_introspection.cc",
387 "json_to_flatbuffer.cc",
388 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700389 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800390 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700391 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700392 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700393 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700394 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700395 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700396 ":json_tokenizer",
Austin Schuhbba10282021-03-20 22:03:28 -0700397 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700398 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700399 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700400 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700401 ],
402)
403
404cc_test(
405 name = "json_to_flatbuffer_test",
406 srcs = [
407 "json_to_flatbuffer_test.cc",
408 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800409 data = [
410 ":json_to_flatbuffer_fbs_reflection_out",
411 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800412 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700413 deps = [
414 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800415 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700416 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700417 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700418 ],
419)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700420
Tyler Chatow5e369a42019-11-23 11:57:31 -0800421cc_test(
422 name = "flatbuffer_introspection_test",
423 srcs = [
424 "flatbuffer_introspection_test.cc",
425 ],
426 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800427 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800428 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800429 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800430 deps = [
431 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800432 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800433 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700434 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800435 "//aos/util:file",
436 "@com_github_google_flatbuffers//:flatbuffers",
437 ],
438)
439
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700440cc_library(
441 name = "flatbuffer_merge",
442 srcs = ["flatbuffer_merge.cc"],
443 hdrs = ["flatbuffer_merge.h"],
444 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800445 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700446 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700447 deps = [
448 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700449 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700450 "@com_github_google_flatbuffers//:flatbuffers",
451 ],
452)
453
454cc_test(
455 name = "flatbuffer_merge_test",
456 srcs = [
457 "flatbuffer_merge_test.cc",
458 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800459 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700460 deps = [
461 ":flatbuffer_merge",
462 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800463 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700464 "//aos/testing:googletest",
465 ],
466)
Austin Schuhe93d8642019-10-13 15:27:07 -0700467
468cc_library(
469 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700470 srcs = [
471 "flatbuffers.cc",
472 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700473 hdrs = [
474 "flatbuffers.h",
475 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800476 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700477 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700478 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800479 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700480 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700481 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700482 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700483 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700484 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800485 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700486 ],
487)
Austin Schuhcb108412019-10-13 16:09:54 -0700488
Brian Silvermand1805b62022-07-20 20:47:05 -0700489rust_library(
490 name = "flatbuffers_rs",
491 srcs = ["flatbuffers.rs"],
492 crate_name = "aos_flatbuffers",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700493 target_compatible_with = select({
494 "//conditions:default": ["//tools/platforms/rust:has_support"],
495 "//tools:has_msan": ["@platforms//:incompatible"],
496 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700497 visibility = ["//visibility:public"],
498 deps = [
499 "@com_github_google_flatbuffers//rust",
500 ],
501)
502
503rust_test(
504 name = "flatbuffers_rs_test",
505 crate = ":flatbuffers_rs",
506 deps = [
507 ":json_to_flatbuffer_rust_fbs",
508 ],
509)
510
Austin Schuhcb108412019-10-13 16:09:54 -0700511cc_test(
512 name = "configuration_test",
513 srcs = [
514 "configuration_test.cc",
515 ],
516 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700517 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700518 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700519 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700520 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700521 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800522 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700523 deps = [
524 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700525 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800526 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700527 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700528 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700529 "//aos/testing:test_logging",
530 ],
531)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700532
533cc_binary(
534 name = "config_flattener",
535 srcs = [
536 "config_flattener.cc",
537 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800538 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700539 visibility = ["//visibility:public"],
540 deps = [
541 ":configuration",
542 ":init",
543 "//aos/util:file",
544 "@com_github_google_glog//:glog",
545 ],
546)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800547
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800548cc_library(
549 name = "aos_cli_utils",
550 srcs = [
551 "aos_cli_utils.cc",
552 ],
553 hdrs = [
554 "aos_cli_utils.h",
555 ],
556 target_compatible_with = ["@platforms//os:linux"],
557 visibility = ["//visibility:public"],
558 deps = [
559 ":configuration",
560 "//aos:init",
561 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700562 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800563 "@com_github_google_glog//:glog",
564 ],
565)
566
Tyler Chatow5e369a42019-11-23 11:57:31 -0800567cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800568 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800569 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800570 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800571 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800572 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800573 visibility = ["//visibility:public"],
574 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800575 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800576 ":configuration",
577 ":json_to_flatbuffer",
578 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800579 "@com_github_google_glog//:glog",
580 ],
581)
582
583cc_binary(
584 name = "aos_send",
585 srcs = [
586 "aos_send.cc",
587 ],
588 target_compatible_with = ["@platforms//os:linux"],
589 visibility = ["//visibility:public"],
590 deps = [
591 ":aos_cli_utils",
592 ":configuration",
593 ":init",
594 ":json_to_flatbuffer",
595 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800596 "@com_github_google_glog//:glog",
597 ],
598)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500599
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700600cc_binary(
601 name = "aos_graph_nodes",
602 srcs = [
603 "aos_graph_nodes.cc",
604 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800605 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700606 visibility = ["//visibility:public"],
607 deps = [
608 ":configuration",
609 ":json_to_flatbuffer",
610 "//aos:init",
611 "//aos/events:shm_event_loop",
612 "@com_github_google_glog//:glog",
613 ],
614)
615
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500616cc_library(
617 name = "ftrace",
618 srcs = [
619 "ftrace.cc",
620 ],
621 hdrs = [
622 "ftrace.h",
623 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800624 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500625 visibility = ["//visibility:public"],
626 deps = [
627 "@com_github_google_glog//:glog",
628 ],
629)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700630
631cc_library(
632 name = "fast_string_builder",
633 srcs = [
634 "fast_string_builder.cc",
635 ],
636 hdrs = [
637 "fast_string_builder.h",
638 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800639 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700640 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700641 deps = [
642 "@com_github_google_glog//:glog",
643 "@com_google_absl//absl/strings",
644 "@com_google_absl//absl/strings:str_format",
645 ],
646)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700647
648cc_library(
649 name = "thread_local",
650 hdrs = [
651 "thread_local.h",
652 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800653 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb47f5552020-10-01 15:08:14 -0700654 visibility = ["//visibility:public"],
655)
Austin Schuhcc6070c2020-10-10 20:25:56 -0700656
657cc_test(
658 name = "realtime_test",
659 srcs = [
660 "realtime_test.cc",
661 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800662 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700663 visibility = ["//visibility:public"],
664 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700665 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700666 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700667 "@com_github_gflags_gflags//:gflags",
668 "@com_github_google_glog//:glog",
669 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700670 ],
671)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800672
673cc_test(
674 name = "flatbuffers_test",
675 srcs = [
676 "flatbuffers_test.cc",
677 ],
678 deps = [
679 ":flatbuffers",
680 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800681 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800682 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700683 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800684 ],
685)
Austin Schuh0de30f32020-12-06 12:44:28 -0800686
687py_binary(
688 name = "flatbuffers_static",
689 srcs = ["flatbuffers_static.py"],
690 visibility = ["//visibility:public"],
691)
Austin Schuh4385b142021-03-14 21:31:13 -0700692
693cc_library(
694 name = "uuid",
695 srcs = ["uuid.cc"],
696 hdrs = ["uuid.h"],
697 target_compatible_with = ["@platforms//os:linux"],
698 visibility = ["//visibility:public"],
699 deps = [
Austin Schuh81d0fe42022-08-17 16:29:23 -0700700 ":thread_local",
Austin Schuh8902fa52021-03-14 22:39:24 -0700701 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700702 "@com_github_google_flatbuffers//:flatbuffers",
703 "@com_github_google_glog//:glog",
704 "@com_google_absl//absl/types:span",
705 ],
706)
707
708cc_test(
709 name = "uuid_test",
710 srcs = ["uuid_test.cc"],
711 target_compatible_with = ["@platforms//os:linux"],
712 deps = [
713 ":uuid",
714 "//aos/testing:googletest",
715 ],
716)
Austin Schuh30f74292021-08-13 17:25:26 -0700717
Brian Silverman10599932022-08-15 06:05:53 -0700718cc_library(
719 name = "uuid_for_rust",
720 hdrs = ["uuid_for_rust.h"],
721 deps = [
722 ":uuid",
723 ],
724)
725
726autocxx_library(
727 name = "uuid_rs",
728 srcs = ["uuid.rs"],
729 crate_name = "aos_uuid",
730 libs = [
731 ":uuid",
732 ":uuid_for_rust",
733 ],
734 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
735 rs_deps = [
736 "//third_party/cargo:uuid",
737 ],
Austin Schuhdfa127f2022-10-26 21:17:42 -0700738 target_compatible_with = select({
739 "//conditions:default": ["//tools/platforms/rust:has_support"],
740 "//tools:has_msan": ["@platforms//:incompatible"],
741 }),
Brian Silverman10599932022-08-15 06:05:53 -0700742 visibility = ["//visibility:public"],
743)
744
Austin Schuh30f74292021-08-13 17:25:26 -0700745cc_binary(
746 name = "aos_graph_channels",
747 srcs = [
748 "aos_graph_channels.cc",
749 ],
750 target_compatible_with = ["@platforms//os:linux"],
751 deps = [
752 "//aos:configuration",
753 "//aos:init",
754 "//aos:json_to_flatbuffer",
755 "//aos/events:simulated_event_loop",
756 "//aos/events/logging:log_reader",
757 "//aos/time",
758 "@com_github_gflags_gflags//:gflags",
759 "@com_github_google_glog//:glog",
760 ],
761)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700762
763cc_library(
764 name = "for_rust",
765 hdrs = [
766 "for_rust.h",
767 ],
768 visibility = ["//visibility:public"],
769 deps = [
770 "//third_party/cargo:cxx_cc",
771 ],
772)