blob: a5fb6c8885ebdba3b780f48d3232046f321f0489 [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 Schuh14056182023-01-03 21:19:38 -0800160 "//aos:init",
161 "//aos/events:shm_event_loop",
Austin Schuh972e47e2018-12-20 17:20:58 -0800162 "//aos/time",
Austin Schuh14056182023-01-03 21:19:38 -0800163 "//aos/util:top",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700164 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700165 ],
166)
167
168cc_library(
John Park398c74a2018-10-20 21:17:39 -0700169 name = "init",
170 srcs = [
171 "init.cc",
172 ],
173 hdrs = [
174 "init.h",
175 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800176 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800177 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700178 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700179 ":realtime",
John Park398c74a2018-10-20 21:17:39 -0700180 "//aos:die",
Austin Schuh972e47e2018-12-20 17:20:58 -0800181 "//aos/logging:implementations",
John Park398c74a2018-10-20 21:17:39 -0700182 ],
John Park398c74a2018-10-20 21:17:39 -0700183)
184
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700185autocxx_library(
186 name = "init_rs",
187 srcs = ["init.rs"],
188 crate_name = "aos_init",
189 libs = [
190 ":init",
191 ],
192 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700193 target_compatible_with = select({
194 "//conditions:default": ["//tools/platforms/rust:has_support"],
195 "//tools:has_msan": ["@platforms//:incompatible"],
196 }),
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700197 visibility = ["//visibility:public"],
198)
199
Alex Perrycb7da4b2019-08-28 19:35:56 -0700200cc_library(
201 name = "realtime",
202 srcs = [
203 "realtime.cc",
204 ],
205 hdrs = [
206 "realtime.h",
207 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800208 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700209 visibility = ["//visibility:public"],
210 deps = [
Austin Schuhcc6070c2020-10-10 20:25:56 -0700211 ":thread_local",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700212 "@com_github_google_glog//:glog",
213 ],
214)
215
Austin Schuhcb108412019-10-13 16:09:54 -0700216flatbuffer_cc_library(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700217 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700218 srcs = ["configuration.fbs"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700219 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800220 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700221 visibility = ["//visibility:public"],
Austin Schuhcb108412019-10-13 16:09:54 -0700222)
223
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700224cc_static_flatbuffer(
225 name = "configuration_schema",
226 function = "aos::ConfigurationSchema",
227 target = ":configuration_fbs_reflection_out",
228 visibility = ["//visibility:public"],
229)
230
Alex Perryd5e13572020-02-22 15:15:08 -0800231flatbuffer_ts_library(
232 name = "configuration_ts_fbs",
233 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800234 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800235 visibility = ["//visibility:public"],
236)
237
Brian Silverman28760272020-02-02 13:21:51 -0800238flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800239 name = "configuration_fbs_python",
240 srcs = ["configuration.fbs"],
241 namespace = "aos",
242 tables = [
243 "Configuration",
244 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800245 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800246 "Map",
247 "Node",
248 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800249 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800250 visibility = ["//visibility:public"],
251)
252
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700253flatbuffer_rust_library(
254 name = "configuration_rust_fbs",
255 srcs = ["configuration.fbs"],
256 crate_name = "aos_configuration_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700257 target_compatible_with = select({
258 "//conditions:default": ["//tools/platforms/rust:has_support"],
259 "//tools:has_msan": ["@platforms//:incompatible"],
260 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700261 visibility = ["//visibility:public"],
262)
263
John Park398c74a2018-10-20 21:17:39 -0700264cc_library(
265 name = "configuration",
266 srcs = [
267 "configuration.cc",
268 ],
269 hdrs = [
270 "configuration.h",
271 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800272 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800273 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700274 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700275 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700276 ":flatbuffer_merge",
277 ":flatbuffers",
278 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700279 "//aos:unique_malloc_ptr",
Austin Schuh217a9782019-12-21 23:02:50 -0800280 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700281 "//aos/util:file",
282 "@com_github_google_glog//:glog",
283 "@com_google_absl//absl/container:btree",
284 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700285 ],
John Park398c74a2018-10-20 21:17:39 -0700286)
287
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700288cc_library(
289 name = "configuration_for_rust",
290 srcs = [
291 "configuration_for_rust.cc",
292 ],
293 hdrs = [
294 "configuration_for_rust.h",
295 ],
296 deps = [
297 ":configuration",
298 ":for_rust",
299 "//third_party/cargo:cxx_cc",
300 ],
301)
302
303autocxx_library(
304 name = "configuration_rs",
305 srcs = ["configuration.rs"],
306 crate_name = "aos_configuration",
307 libs = [
308 ":configuration",
309 ":configuration_for_rust",
310 ":configuration_fbs",
311 ],
312 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700313 target_compatible_with = select({
314 "//conditions:default": ["//tools/platforms/rust:has_support"],
315 "//tools:has_msan": ["@platforms//:incompatible"],
316 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700317 visibility = ["//visibility:public"],
318 deps = [
319 ":configuration_rust_fbs",
320 ":flatbuffers_rs",
321 "//third_party/cargo:thiserror",
322 ],
323)
324
325rust_test(
326 name = "configuration_rs_test",
327 crate = ":configuration_rs",
328 data = [
329 "//aos/testdata:test_configs",
330 ],
331 # TODO: Make Rust play happy with pic vs nopic. Details at:
332 # https://github.com/bazelbuild/rules_rust/issues/118
333 rustc_flags = ["-Crelocation-model=static"],
334)
335
James Kuszmaulabb77132020-08-01 19:56:16 -0700336flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800337 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700338 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800339 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700340 visibility = ["//aos:__subpackages__"],
341)
342
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700343flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800344 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700345 srcs = ["json_to_flatbuffer.fbs"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800346 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800347 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700348 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700349)
350
Brian Silvermand1805b62022-07-20 20:47:05 -0700351flatbuffer_rust_library(
352 name = "json_to_flatbuffer_rust_fbs",
353 srcs = ["json_to_flatbuffer.fbs"],
354 crate_name = "aos_json_to_flatbuffer_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700355 target_compatible_with = select({
356 "//conditions:default": ["//tools/platforms/rust:has_support"],
357 "//tools:has_msan": ["@platforms//:incompatible"],
358 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700359 visibility = ["//aos:__subpackages__"],
360)
361
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700362cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700363 name = "flatbuffer_utils",
364 srcs = ["flatbuffer_utils.cc"],
365 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800366 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700367 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700368 deps = [
369 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800370 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700371 ],
372)
373
374cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700375 name = "json_tokenizer",
376 srcs = ["json_tokenizer.cc"],
377 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800378 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700379 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700380 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700381 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700382 "@com_google_absl//absl/strings",
383 ],
384)
385
386cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700387 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800388 srcs = [
389 "flatbuffer_introspection.cc",
390 "json_to_flatbuffer.cc",
391 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700392 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800393 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700394 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700395 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700396 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700397 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700398 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700399 ":json_tokenizer",
Austin Schuhbba10282021-03-20 22:03:28 -0700400 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700401 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700402 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700403 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700404 ],
405)
406
407cc_test(
408 name = "json_to_flatbuffer_test",
409 srcs = [
410 "json_to_flatbuffer_test.cc",
411 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800412 data = [
413 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800414 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800415 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800416 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700417 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800418 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700419 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800420 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700421 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700422 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700423 ],
424)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700425
Tyler Chatow5e369a42019-11-23 11:57:31 -0800426cc_test(
427 name = "flatbuffer_introspection_test",
428 srcs = [
429 "flatbuffer_introspection_test.cc",
430 ],
431 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800432 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800433 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800434 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800435 deps = [
436 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800437 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800438 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700439 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800440 "//aos/util:file",
441 "@com_github_google_flatbuffers//:flatbuffers",
442 ],
443)
444
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700445cc_library(
446 name = "flatbuffer_merge",
447 srcs = ["flatbuffer_merge.cc"],
448 hdrs = ["flatbuffer_merge.h"],
449 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800450 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700451 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700452 deps = [
453 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700454 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700455 "@com_github_google_flatbuffers//:flatbuffers",
456 ],
457)
458
459cc_test(
460 name = "flatbuffer_merge_test",
461 srcs = [
462 "flatbuffer_merge_test.cc",
463 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800464 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700465 deps = [
466 ":flatbuffer_merge",
467 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800468 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700469 "//aos/testing:googletest",
470 ],
471)
Austin Schuhe93d8642019-10-13 15:27:07 -0700472
473cc_library(
474 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700475 srcs = [
476 "flatbuffers.cc",
477 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700478 hdrs = [
479 "flatbuffers.h",
480 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800481 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700482 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700483 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800484 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700485 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700486 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700487 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700488 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700489 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800490 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700491 ],
492)
Austin Schuhcb108412019-10-13 16:09:54 -0700493
Brian Silvermand1805b62022-07-20 20:47:05 -0700494rust_library(
495 name = "flatbuffers_rs",
496 srcs = ["flatbuffers.rs"],
497 crate_name = "aos_flatbuffers",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700498 target_compatible_with = select({
499 "//conditions:default": ["//tools/platforms/rust:has_support"],
500 "//tools:has_msan": ["@platforms//:incompatible"],
501 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700502 visibility = ["//visibility:public"],
503 deps = [
504 "@com_github_google_flatbuffers//rust",
505 ],
506)
507
508rust_test(
509 name = "flatbuffers_rs_test",
510 crate = ":flatbuffers_rs",
511 deps = [
512 ":json_to_flatbuffer_rust_fbs",
513 ],
514)
515
Austin Schuhcb108412019-10-13 16:09:54 -0700516cc_test(
517 name = "configuration_test",
518 srcs = [
519 "configuration_test.cc",
520 ],
521 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700522 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700523 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700524 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700525 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700526 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800527 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700528 deps = [
529 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700530 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800531 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700532 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700533 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700534 "//aos/testing:test_logging",
535 ],
536)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700537
538cc_binary(
539 name = "config_flattener",
540 srcs = [
541 "config_flattener.cc",
542 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800543 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700544 visibility = ["//visibility:public"],
545 deps = [
546 ":configuration",
547 ":init",
548 "//aos/util:file",
549 "@com_github_google_glog//:glog",
550 ],
551)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800552
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800553cc_library(
554 name = "aos_cli_utils",
555 srcs = [
556 "aos_cli_utils.cc",
557 ],
558 hdrs = [
559 "aos_cli_utils.h",
560 ],
561 target_compatible_with = ["@platforms//os:linux"],
562 visibility = ["//visibility:public"],
563 deps = [
564 ":configuration",
565 "//aos:init",
566 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700567 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800568 "@com_github_google_glog//:glog",
569 ],
570)
571
Tyler Chatow5e369a42019-11-23 11:57:31 -0800572cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800573 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800574 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800575 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800576 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800577 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800578 visibility = ["//visibility:public"],
579 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800580 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800581 ":configuration",
582 ":json_to_flatbuffer",
583 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800584 "@com_github_google_glog//:glog",
585 ],
586)
587
588cc_binary(
589 name = "aos_send",
590 srcs = [
591 "aos_send.cc",
592 ],
593 target_compatible_with = ["@platforms//os:linux"],
594 visibility = ["//visibility:public"],
595 deps = [
596 ":aos_cli_utils",
597 ":configuration",
598 ":init",
599 ":json_to_flatbuffer",
600 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800601 "@com_github_google_glog//:glog",
602 ],
603)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500604
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700605cc_binary(
606 name = "aos_graph_nodes",
607 srcs = [
608 "aos_graph_nodes.cc",
609 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800610 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700611 visibility = ["//visibility:public"],
612 deps = [
613 ":configuration",
614 ":json_to_flatbuffer",
615 "//aos:init",
616 "//aos/events:shm_event_loop",
617 "@com_github_google_glog//:glog",
618 ],
619)
620
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500621cc_library(
622 name = "ftrace",
623 srcs = [
624 "ftrace.cc",
625 ],
626 hdrs = [
627 "ftrace.h",
628 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800629 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500630 visibility = ["//visibility:public"],
631 deps = [
632 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800633 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500634 ],
635)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700636
637cc_library(
638 name = "fast_string_builder",
639 srcs = [
640 "fast_string_builder.cc",
641 ],
642 hdrs = [
643 "fast_string_builder.h",
644 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800645 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700646 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700647 deps = [
648 "@com_github_google_glog//:glog",
649 "@com_google_absl//absl/strings",
650 "@com_google_absl//absl/strings:str_format",
651 ],
652)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700653
654cc_library(
655 name = "thread_local",
656 hdrs = [
657 "thread_local.h",
658 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800659 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb47f5552020-10-01 15:08:14 -0700660 visibility = ["//visibility:public"],
661)
Austin Schuhcc6070c2020-10-10 20:25:56 -0700662
663cc_test(
664 name = "realtime_test",
665 srcs = [
666 "realtime_test.cc",
667 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800668 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700669 visibility = ["//visibility:public"],
670 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700671 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700672 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700673 "@com_github_gflags_gflags//:gflags",
674 "@com_github_google_glog//:glog",
675 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700676 ],
677)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800678
679cc_test(
680 name = "flatbuffers_test",
681 srcs = [
682 "flatbuffers_test.cc",
683 ],
684 deps = [
685 ":flatbuffers",
686 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800687 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800688 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700689 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800690 ],
691)
Austin Schuh0de30f32020-12-06 12:44:28 -0800692
693py_binary(
694 name = "flatbuffers_static",
695 srcs = ["flatbuffers_static.py"],
696 visibility = ["//visibility:public"],
697)
Austin Schuh4385b142021-03-14 21:31:13 -0700698
699cc_library(
700 name = "uuid",
701 srcs = ["uuid.cc"],
702 hdrs = ["uuid.h"],
703 target_compatible_with = ["@platforms//os:linux"],
704 visibility = ["//visibility:public"],
705 deps = [
Austin Schuh81d0fe42022-08-17 16:29:23 -0700706 ":thread_local",
Austin Schuh8902fa52021-03-14 22:39:24 -0700707 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700708 "@com_github_google_flatbuffers//:flatbuffers",
709 "@com_github_google_glog//:glog",
710 "@com_google_absl//absl/types:span",
711 ],
712)
713
714cc_test(
715 name = "uuid_test",
716 srcs = ["uuid_test.cc"],
717 target_compatible_with = ["@platforms//os:linux"],
718 deps = [
719 ":uuid",
720 "//aos/testing:googletest",
721 ],
722)
Austin Schuh30f74292021-08-13 17:25:26 -0700723
Brian Silverman10599932022-08-15 06:05:53 -0700724cc_library(
725 name = "uuid_for_rust",
726 hdrs = ["uuid_for_rust.h"],
727 deps = [
728 ":uuid",
729 ],
730)
731
732autocxx_library(
733 name = "uuid_rs",
734 srcs = ["uuid.rs"],
735 crate_name = "aos_uuid",
736 libs = [
737 ":uuid",
738 ":uuid_for_rust",
739 ],
740 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
741 rs_deps = [
742 "//third_party/cargo:uuid",
743 ],
Austin Schuhdfa127f2022-10-26 21:17:42 -0700744 target_compatible_with = select({
745 "//conditions:default": ["//tools/platforms/rust:has_support"],
746 "//tools:has_msan": ["@platforms//:incompatible"],
747 }),
Brian Silverman10599932022-08-15 06:05:53 -0700748 visibility = ["//visibility:public"],
749)
750
Austin Schuh30f74292021-08-13 17:25:26 -0700751cc_binary(
752 name = "aos_graph_channels",
753 srcs = [
754 "aos_graph_channels.cc",
755 ],
756 target_compatible_with = ["@platforms//os:linux"],
757 deps = [
758 "//aos:configuration",
759 "//aos:init",
760 "//aos:json_to_flatbuffer",
761 "//aos/events:simulated_event_loop",
762 "//aos/events/logging:log_reader",
763 "//aos/time",
764 "@com_github_gflags_gflags//:gflags",
765 "@com_github_google_glog//:glog",
766 ],
767)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700768
769cc_library(
770 name = "for_rust",
771 hdrs = [
772 "for_rust.h",
773 ],
774 visibility = ["//visibility:public"],
775 deps = [
776 "//third_party/cargo:cxx_cc",
777 ],
778)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700779
780cc_library(
781 name = "sha256",
782 srcs = [
783 "sha256.cc",
784 ],
785 hdrs = ["sha256.h"],
786 target_compatible_with = ["@platforms//os:linux"],
787 visibility = ["//visibility:public"],
788 deps = [
789 "@boringssl//:crypto",
790 "@com_google_absl//absl/types:span",
791 ],
792)