blob: 596996bcb1cecc7bfaefb0a0f1b10906307a4b09 [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 = [
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700517 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700518 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700519 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700520 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800521 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700522 deps = [
523 ":configuration",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800524 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700525 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700526 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700527 "//aos/testing:test_logging",
528 ],
529)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700530
531cc_binary(
532 name = "config_flattener",
533 srcs = [
534 "config_flattener.cc",
535 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800536 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700537 visibility = ["//visibility:public"],
538 deps = [
539 ":configuration",
540 ":init",
541 "//aos/util:file",
542 "@com_github_google_glog//:glog",
543 ],
544)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800545
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800546cc_library(
547 name = "aos_cli_utils",
548 srcs = [
549 "aos_cli_utils.cc",
550 ],
551 hdrs = [
552 "aos_cli_utils.h",
553 ],
554 target_compatible_with = ["@platforms//os:linux"],
555 visibility = ["//visibility:public"],
556 deps = [
557 ":configuration",
558 "//aos:init",
559 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700560 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800561 "@com_github_google_glog//:glog",
562 ],
563)
564
Tyler Chatow5e369a42019-11-23 11:57:31 -0800565cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800566 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800567 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800568 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800569 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800570 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800571 visibility = ["//visibility:public"],
572 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800573 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800574 ":configuration",
575 ":json_to_flatbuffer",
576 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800577 "@com_github_google_glog//:glog",
578 ],
579)
580
581cc_binary(
582 name = "aos_send",
583 srcs = [
584 "aos_send.cc",
585 ],
586 target_compatible_with = ["@platforms//os:linux"],
587 visibility = ["//visibility:public"],
588 deps = [
589 ":aos_cli_utils",
590 ":configuration",
591 ":init",
592 ":json_to_flatbuffer",
593 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800594 "@com_github_google_glog//:glog",
595 ],
596)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500597
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700598cc_binary(
599 name = "aos_graph_nodes",
600 srcs = [
601 "aos_graph_nodes.cc",
602 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800603 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700604 visibility = ["//visibility:public"],
605 deps = [
606 ":configuration",
607 ":json_to_flatbuffer",
608 "//aos:init",
609 "//aos/events:shm_event_loop",
610 "@com_github_google_glog//:glog",
611 ],
612)
613
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500614cc_library(
615 name = "ftrace",
616 srcs = [
617 "ftrace.cc",
618 ],
619 hdrs = [
620 "ftrace.h",
621 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800622 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500623 visibility = ["//visibility:public"],
624 deps = [
625 "@com_github_google_glog//:glog",
626 ],
627)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700628
629cc_library(
630 name = "fast_string_builder",
631 srcs = [
632 "fast_string_builder.cc",
633 ],
634 hdrs = [
635 "fast_string_builder.h",
636 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800637 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700638 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700639 deps = [
640 "@com_github_google_glog//:glog",
641 "@com_google_absl//absl/strings",
642 "@com_google_absl//absl/strings:str_format",
643 ],
644)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700645
646cc_library(
647 name = "thread_local",
648 hdrs = [
649 "thread_local.h",
650 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800651 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb47f5552020-10-01 15:08:14 -0700652 visibility = ["//visibility:public"],
653)
Austin Schuhcc6070c2020-10-10 20:25:56 -0700654
655cc_test(
656 name = "realtime_test",
657 srcs = [
658 "realtime_test.cc",
659 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800660 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700661 visibility = ["//visibility:public"],
662 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700663 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700664 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700665 "@com_github_gflags_gflags//:gflags",
666 "@com_github_google_glog//:glog",
667 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700668 ],
669)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800670
671cc_test(
672 name = "flatbuffers_test",
673 srcs = [
674 "flatbuffers_test.cc",
675 ],
676 deps = [
677 ":flatbuffers",
678 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800679 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800680 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700681 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800682 ],
683)
Austin Schuh0de30f32020-12-06 12:44:28 -0800684
685py_binary(
686 name = "flatbuffers_static",
687 srcs = ["flatbuffers_static.py"],
688 visibility = ["//visibility:public"],
689)
Austin Schuh4385b142021-03-14 21:31:13 -0700690
691cc_library(
692 name = "uuid",
693 srcs = ["uuid.cc"],
694 hdrs = ["uuid.h"],
695 target_compatible_with = ["@platforms//os:linux"],
696 visibility = ["//visibility:public"],
697 deps = [
Austin Schuh81d0fe42022-08-17 16:29:23 -0700698 ":thread_local",
Austin Schuh8902fa52021-03-14 22:39:24 -0700699 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700700 "@com_github_google_flatbuffers//:flatbuffers",
701 "@com_github_google_glog//:glog",
702 "@com_google_absl//absl/types:span",
703 ],
704)
705
706cc_test(
707 name = "uuid_test",
708 srcs = ["uuid_test.cc"],
709 target_compatible_with = ["@platforms//os:linux"],
710 deps = [
711 ":uuid",
712 "//aos/testing:googletest",
713 ],
714)
Austin Schuh30f74292021-08-13 17:25:26 -0700715
Brian Silverman10599932022-08-15 06:05:53 -0700716cc_library(
717 name = "uuid_for_rust",
718 hdrs = ["uuid_for_rust.h"],
719 deps = [
720 ":uuid",
721 ],
722)
723
724autocxx_library(
725 name = "uuid_rs",
726 srcs = ["uuid.rs"],
727 crate_name = "aos_uuid",
728 libs = [
729 ":uuid",
730 ":uuid_for_rust",
731 ],
732 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
733 rs_deps = [
734 "//third_party/cargo:uuid",
735 ],
Austin Schuhdfa127f2022-10-26 21:17:42 -0700736 target_compatible_with = select({
737 "//conditions:default": ["//tools/platforms/rust:has_support"],
738 "//tools:has_msan": ["@platforms//:incompatible"],
739 }),
Brian Silverman10599932022-08-15 06:05:53 -0700740 visibility = ["//visibility:public"],
741)
742
Austin Schuh30f74292021-08-13 17:25:26 -0700743cc_binary(
744 name = "aos_graph_channels",
745 srcs = [
746 "aos_graph_channels.cc",
747 ],
748 target_compatible_with = ["@platforms//os:linux"],
749 deps = [
750 "//aos:configuration",
751 "//aos:init",
752 "//aos:json_to_flatbuffer",
753 "//aos/events:simulated_event_loop",
754 "//aos/events/logging:log_reader",
755 "//aos/time",
756 "@com_github_gflags_gflags//:gflags",
757 "@com_github_google_glog//:glog",
758 ],
759)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700760
761cc_library(
762 name = "for_rust",
763 hdrs = [
764 "for_rust.h",
765 ],
766 visibility = ["//visibility:public"],
767 deps = [
768 "//third_party/cargo:cxx_cc",
769 ],
770)