blob: b8468bd175e68e305e61f20f9052cf1bc7f8539c [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",
414 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800415 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700416 deps = [
417 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800418 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700419 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700420 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700421 ],
422)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700423
Tyler Chatow5e369a42019-11-23 11:57:31 -0800424cc_test(
425 name = "flatbuffer_introspection_test",
426 srcs = [
427 "flatbuffer_introspection_test.cc",
428 ],
429 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800430 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800431 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800432 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800433 deps = [
434 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800435 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800436 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700437 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800438 "//aos/util:file",
439 "@com_github_google_flatbuffers//:flatbuffers",
440 ],
441)
442
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700443cc_library(
444 name = "flatbuffer_merge",
445 srcs = ["flatbuffer_merge.cc"],
446 hdrs = ["flatbuffer_merge.h"],
447 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800448 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700449 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700450 deps = [
451 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700452 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700453 "@com_github_google_flatbuffers//:flatbuffers",
454 ],
455)
456
457cc_test(
458 name = "flatbuffer_merge_test",
459 srcs = [
460 "flatbuffer_merge_test.cc",
461 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800462 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700463 deps = [
464 ":flatbuffer_merge",
465 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800466 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700467 "//aos/testing:googletest",
468 ],
469)
Austin Schuhe93d8642019-10-13 15:27:07 -0700470
471cc_library(
472 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700473 srcs = [
474 "flatbuffers.cc",
475 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700476 hdrs = [
477 "flatbuffers.h",
478 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800479 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700480 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700481 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800482 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700483 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700484 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700485 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700486 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700487 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800488 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700489 ],
490)
Austin Schuhcb108412019-10-13 16:09:54 -0700491
Brian Silvermand1805b62022-07-20 20:47:05 -0700492rust_library(
493 name = "flatbuffers_rs",
494 srcs = ["flatbuffers.rs"],
495 crate_name = "aos_flatbuffers",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700496 target_compatible_with = select({
497 "//conditions:default": ["//tools/platforms/rust:has_support"],
498 "//tools:has_msan": ["@platforms//:incompatible"],
499 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700500 visibility = ["//visibility:public"],
501 deps = [
502 "@com_github_google_flatbuffers//rust",
503 ],
504)
505
506rust_test(
507 name = "flatbuffers_rs_test",
508 crate = ":flatbuffers_rs",
509 deps = [
510 ":json_to_flatbuffer_rust_fbs",
511 ],
512)
513
Austin Schuhcb108412019-10-13 16:09:54 -0700514cc_test(
515 name = "configuration_test",
516 srcs = [
517 "configuration_test.cc",
518 ],
519 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700520 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700521 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700522 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700523 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700524 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800525 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700526 deps = [
527 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700528 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800529 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700530 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700531 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700532 "//aos/testing:test_logging",
533 ],
534)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700535
536cc_binary(
537 name = "config_flattener",
538 srcs = [
539 "config_flattener.cc",
540 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800541 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700542 visibility = ["//visibility:public"],
543 deps = [
544 ":configuration",
545 ":init",
546 "//aos/util:file",
547 "@com_github_google_glog//:glog",
548 ],
549)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800550
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800551cc_library(
552 name = "aos_cli_utils",
553 srcs = [
554 "aos_cli_utils.cc",
555 ],
556 hdrs = [
557 "aos_cli_utils.h",
558 ],
559 target_compatible_with = ["@platforms//os:linux"],
560 visibility = ["//visibility:public"],
561 deps = [
562 ":configuration",
563 "//aos:init",
564 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700565 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800566 "@com_github_google_glog//:glog",
567 ],
568)
569
Tyler Chatow5e369a42019-11-23 11:57:31 -0800570cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800571 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800572 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800573 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800574 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800575 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800576 visibility = ["//visibility:public"],
577 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800578 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800579 ":configuration",
580 ":json_to_flatbuffer",
581 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800582 "@com_github_google_glog//:glog",
583 ],
584)
585
586cc_binary(
587 name = "aos_send",
588 srcs = [
589 "aos_send.cc",
590 ],
591 target_compatible_with = ["@platforms//os:linux"],
592 visibility = ["//visibility:public"],
593 deps = [
594 ":aos_cli_utils",
595 ":configuration",
596 ":init",
597 ":json_to_flatbuffer",
598 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800599 "@com_github_google_glog//:glog",
600 ],
601)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500602
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700603cc_binary(
604 name = "aos_graph_nodes",
605 srcs = [
606 "aos_graph_nodes.cc",
607 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800608 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700609 visibility = ["//visibility:public"],
610 deps = [
611 ":configuration",
612 ":json_to_flatbuffer",
613 "//aos:init",
614 "//aos/events:shm_event_loop",
615 "@com_github_google_glog//:glog",
616 ],
617)
618
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500619cc_library(
620 name = "ftrace",
621 srcs = [
622 "ftrace.cc",
623 ],
624 hdrs = [
625 "ftrace.h",
626 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800627 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500628 visibility = ["//visibility:public"],
629 deps = [
630 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800631 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500632 ],
633)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700634
635cc_library(
636 name = "fast_string_builder",
637 srcs = [
638 "fast_string_builder.cc",
639 ],
640 hdrs = [
641 "fast_string_builder.h",
642 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800643 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700644 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700645 deps = [
646 "@com_github_google_glog//:glog",
647 "@com_google_absl//absl/strings",
648 "@com_google_absl//absl/strings:str_format",
649 ],
650)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700651
652cc_library(
653 name = "thread_local",
654 hdrs = [
655 "thread_local.h",
656 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800657 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb47f5552020-10-01 15:08:14 -0700658 visibility = ["//visibility:public"],
659)
Austin Schuhcc6070c2020-10-10 20:25:56 -0700660
661cc_test(
662 name = "realtime_test",
663 srcs = [
664 "realtime_test.cc",
665 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800666 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700667 visibility = ["//visibility:public"],
668 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700669 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700670 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700671 "@com_github_gflags_gflags//:gflags",
672 "@com_github_google_glog//:glog",
673 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700674 ],
675)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800676
677cc_test(
678 name = "flatbuffers_test",
679 srcs = [
680 "flatbuffers_test.cc",
681 ],
682 deps = [
683 ":flatbuffers",
684 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800685 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800686 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700687 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800688 ],
689)
Austin Schuh0de30f32020-12-06 12:44:28 -0800690
691py_binary(
692 name = "flatbuffers_static",
693 srcs = ["flatbuffers_static.py"],
694 visibility = ["//visibility:public"],
695)
Austin Schuh4385b142021-03-14 21:31:13 -0700696
697cc_library(
698 name = "uuid",
699 srcs = ["uuid.cc"],
700 hdrs = ["uuid.h"],
701 target_compatible_with = ["@platforms//os:linux"],
702 visibility = ["//visibility:public"],
703 deps = [
Austin Schuh81d0fe42022-08-17 16:29:23 -0700704 ":thread_local",
Austin Schuh8902fa52021-03-14 22:39:24 -0700705 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700706 "@com_github_google_flatbuffers//:flatbuffers",
707 "@com_github_google_glog//:glog",
708 "@com_google_absl//absl/types:span",
709 ],
710)
711
712cc_test(
713 name = "uuid_test",
714 srcs = ["uuid_test.cc"],
715 target_compatible_with = ["@platforms//os:linux"],
716 deps = [
717 ":uuid",
718 "//aos/testing:googletest",
719 ],
720)
Austin Schuh30f74292021-08-13 17:25:26 -0700721
Brian Silverman10599932022-08-15 06:05:53 -0700722cc_library(
723 name = "uuid_for_rust",
724 hdrs = ["uuid_for_rust.h"],
725 deps = [
726 ":uuid",
727 ],
728)
729
730autocxx_library(
731 name = "uuid_rs",
732 srcs = ["uuid.rs"],
733 crate_name = "aos_uuid",
734 libs = [
735 ":uuid",
736 ":uuid_for_rust",
737 ],
738 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
739 rs_deps = [
740 "//third_party/cargo:uuid",
741 ],
Austin Schuhdfa127f2022-10-26 21:17:42 -0700742 target_compatible_with = select({
743 "//conditions:default": ["//tools/platforms/rust:has_support"],
744 "//tools:has_msan": ["@platforms//:incompatible"],
745 }),
Brian Silverman10599932022-08-15 06:05:53 -0700746 visibility = ["//visibility:public"],
747)
748
Austin Schuh30f74292021-08-13 17:25:26 -0700749cc_binary(
750 name = "aos_graph_channels",
751 srcs = [
752 "aos_graph_channels.cc",
753 ],
754 target_compatible_with = ["@platforms//os:linux"],
755 deps = [
756 "//aos:configuration",
757 "//aos:init",
758 "//aos:json_to_flatbuffer",
759 "//aos/events:simulated_event_loop",
760 "//aos/events/logging:log_reader",
761 "//aos/time",
762 "@com_github_gflags_gflags//:gflags",
763 "@com_github_google_glog//:glog",
764 ],
765)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700766
767cc_library(
768 name = "for_rust",
769 hdrs = [
770 "for_rust.h",
771 ],
772 visibility = ["//visibility:public"],
773 deps = [
774 "//third_party/cargo:cxx_cc",
775 ],
776)