blob: b6d357baa2e5df5f9ef3b6d11381da1125f48073 [file] [log] [blame]
Adam Snaider0967b812023-11-02 15:29:43 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library")
Austin Schuha1d006e2022-09-14 21:50:42 -07002load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
James Kuszmaule4aa01d2022-06-28 14:09:02 -07003load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
Austin Schuh8f99c822024-05-05 22:43:40 -07004load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Brian Silverman7edd1ce2022-07-23 16:10:54 -07005load("//tools/build_rules:autocxx.bzl", "autocxx_library")
Austin Schuh605d5ff2024-05-10 15:59:54 -07006load("//tools/build_rules:select.bzl", "compiler_select")
Adam Snaiderf560ae92023-11-07 17:06:21 -08007load("//tools/rust:defs.bzl", "flatbuffer_rust_library", "rust_library")
Austin Schuh972e47e2018-12-20 17:20:58 -08008
Austin Schuh00e302a2020-12-21 11:53:30 -08009exports_files(["aos_dump_autocomplete.sh"])
10
Brian Silverman258b9172015-09-19 14:32:57 -040011filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070012 name = "prime_binaries",
13 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080014 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070015 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080016 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080017 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070018 ],
19 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080020)
Austin Schuhc80dd152016-02-29 01:47:44 -080021
22filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070023 name = "prime_start_binaries",
24 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080025 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070026 ],
27 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080028)
Brian Silverman6470f442018-08-05 12:08:16 -070029
Austin Schuhc80dd152016-02-29 01:47:44 -080030filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070031 name = "prime_binaries_stripped",
32 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080033 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070034 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080035 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070036 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070037 ],
38 visibility = ["//visibility:public"],
39)
40
41filegroup(
42 name = "prime_start_binaries_stripped",
43 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080044 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070045 ],
46 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080047)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070048
49cc_library(
John Park33858a32018-09-28 23:05:48 -070050 name = "math",
51 hdrs = [
52 "commonmath.h",
53 ],
John Park33858a32018-09-28 23:05:48 -070054 visibility = ["//visibility:public"],
55)
56
Brian Silverman6470f442018-08-05 12:08:16 -070057py_library(
58 name = "python_init",
59 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080060 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070061 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070062)
John Park33858a32018-09-28 23:05:48 -070063
64cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080065 name = "macros",
66 hdrs = [
John Park33858a32018-09-28 23:05:48 -070067 "macros.h",
John Park33858a32018-09-28 23:05:48 -070068 ],
69 visibility = ["//visibility:public"],
70)
71
72cc_library(
73 name = "gtest_prod",
74 hdrs = [
75 "gtest_prod.h",
76 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080077 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070078 visibility = ["//visibility:public"],
79)
80
81cc_library(
John Park33858a32018-09-28 23:05:48 -070082 name = "unique_malloc_ptr",
83 hdrs = [
84 "unique_malloc_ptr.h",
85 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080086 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070087 visibility = ["//visibility:public"],
88)
89
90cc_library(
91 name = "condition",
92 srcs = [
93 "condition.cc",
94 ],
95 hdrs = [
96 "condition.h",
97 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080098 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070099 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800100 deps = [
101 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -0800102 "//aos/mutex",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700103 "@com_github_google_glog//:glog",
Austin Schuh972e47e2018-12-20 17:20:58 -0800104 ],
John Park33858a32018-09-28 23:05:48 -0700105)
106
107cc_test(
108 name = "condition_test",
109 srcs = [
110 "condition_test.cc",
111 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800112 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700113 deps = [
114 ":condition",
115 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700116 "//aos/ipc_lib:aos_sync",
117 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800118 "//aos/logging",
119 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700120 "//aos/testing:googletest",
121 "//aos/testing:prevent_exit",
122 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800123 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700124 ],
125)
126
127cc_library(
128 name = "die",
129 srcs = [
130 "die.cc",
131 ],
132 hdrs = [
133 "die.h",
134 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800135 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800136 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700137 deps = [
138 "//aos:macros",
139 "//aos/libc:aos_strerror",
140 ],
John Park33858a32018-09-28 23:05:48 -0700141)
142
John Park33858a32018-09-28 23:05:48 -0700143cc_test(
144 name = "die_test",
145 srcs = [
146 "die_test.cc",
147 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800148 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700149 deps = [
150 ":die",
151 "//aos/testing:googletest",
152 ],
153)
154
John Park398c74a2018-10-20 21:17:39 -0700155cc_binary(
156 name = "dump_rtprio",
157 srcs = [
158 "dump_rtprio.cc",
159 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800160 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700161 deps = [
Austin Schuh14056182023-01-03 21:19:38 -0800162 "//aos:init",
163 "//aos/events:shm_event_loop",
Austin Schuh972e47e2018-12-20 17:20:58 -0800164 "//aos/time",
Austin Schuh14056182023-01-03 21:19:38 -0800165 "//aos/util:top",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700166 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700167 ],
168)
169
170cc_library(
John Park398c74a2018-10-20 21:17:39 -0700171 name = "init",
172 srcs = [
173 "init.cc",
174 ],
175 hdrs = [
176 "init.h",
177 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800178 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800179 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700180 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700181 ":realtime",
James Kuszmaula791b762023-07-13 14:56:21 -0700182 ":uuid",
John Park398c74a2018-10-20 21:17:39 -0700183 "//aos:die",
Austin Schuhfc0caa82023-08-25 14:25:03 -0700184 "//aos/logging",
John Park398c74a2018-10-20 21:17:39 -0700185 ],
John Park398c74a2018-10-20 21:17:39 -0700186)
187
Adam Snaider48a62f32023-10-02 15:49:23 -0700188cc_library(
189 name = "init_for_rust",
190 srcs = [
191 "init_for_rust.cc",
192 ],
193 hdrs = [
194 "init_for_rust.h",
195 ],
196 deps = [
197 ":for_rust",
198 ":init",
199 "//aos/logging",
200 "@com_github_gflags_gflags//:gflags",
201 "@crate_index//:cxx_cc",
202 ],
203)
204
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700205autocxx_library(
206 name = "init_rs",
207 srcs = ["init.rs"],
208 crate_name = "aos_init",
209 libs = [
Adam Snaider48a62f32023-10-02 15:49:23 -0700210 ":init_for_rust",
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700211 ],
212 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700213 visibility = ["//visibility:public"],
Adam Snaider48a62f32023-10-02 15:49:23 -0700214 deps = [
215 "@crate_index//:clap",
Adam Snaider9121b302023-12-14 15:30:54 -0800216 "@crate_index//:env_logger",
Adam Snaider48a62f32023-10-02 15:49:23 -0700217 ],
218)
219
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700220autocxx_library(
221 name = "test_init_rs",
222 testonly = True,
223 srcs = ["test_init.rs"],
224 crate_name = "aos_test_init",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800225 gen_docs = False,
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700226 libs = [
227 "//aos/testing:tmpdir",
228 ],
229 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700230 visibility = ["//visibility:public"],
231 deps = [
232 ":init_rs",
Adam Snaider9121b302023-12-14 15:30:54 -0800233 "@crate_index//:env_logger",
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700234 ],
235)
236
Alex Perrycb7da4b2019-08-28 19:35:56 -0700237cc_library(
238 name = "realtime",
239 srcs = [
240 "realtime.cc",
241 ],
242 hdrs = [
243 "realtime.h",
244 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800245 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700246 visibility = ["//visibility:public"],
247 deps = [
James Kuszmaula791b762023-07-13 14:56:21 -0700248 ":uuid",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700249 "@com_github_google_glog//:glog",
250 ],
251)
252
James Kuszmaulf01da392023-12-14 11:22:14 -0800253static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700254 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700255 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800256 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700257 visibility = ["//visibility:public"],
James Kuszmaul1e57af92023-12-20 15:34:54 -0800258 deps = ["//aos/flatbuffers/reflection:reflection_fbs"],
Austin Schuhcb108412019-10-13 16:09:54 -0700259)
260
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700261cc_static_flatbuffer(
262 name = "configuration_schema",
263 function = "aos::ConfigurationSchema",
264 target = ":configuration_fbs_reflection_out",
265 visibility = ["//visibility:public"],
266)
267
Alex Perryd5e13572020-02-22 15:15:08 -0800268flatbuffer_ts_library(
269 name = "configuration_ts_fbs",
270 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800271 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800272 visibility = ["//visibility:public"],
273)
274
Brian Silverman28760272020-02-02 13:21:51 -0800275flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800276 name = "configuration_fbs_python",
277 srcs = ["configuration.fbs"],
278 namespace = "aos",
279 tables = [
280 "Configuration",
281 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800282 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800283 "Map",
284 "Node",
285 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800286 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800287 visibility = ["//visibility:public"],
288)
289
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700290flatbuffer_rust_library(
291 name = "configuration_rust_fbs",
292 srcs = ["configuration.fbs"],
293 crate_name = "aos_configuration_fbs",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700294 visibility = ["//visibility:public"],
295)
296
John Park398c74a2018-10-20 21:17:39 -0700297cc_library(
298 name = "configuration",
299 srcs = [
300 "configuration.cc",
301 ],
302 hdrs = [
303 "configuration.h",
304 ],
Austin Schuh605d5ff2024-05-10 15:59:54 -0700305 copts = compiler_select({
306 "clang": [],
307 "gcc": ["-Wno-missing-field-initializers"],
308 }),
Philipp Schraderdada1072020-11-24 11:34:46 -0800309 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800310 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700311 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700312 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700313 ":flatbuffer_merge",
314 ":flatbuffers",
315 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700316 "//aos:unique_malloc_ptr",
Austin Schuh83cbb1e2023-06-23 12:59:02 -0700317 "//aos/ipc_lib:index",
Austin Schuh217a9782019-12-21 23:02:50 -0800318 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700319 "//aos/util:file",
320 "@com_github_google_glog//:glog",
321 "@com_google_absl//absl/container:btree",
322 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700323 ],
John Park398c74a2018-10-20 21:17:39 -0700324)
325
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700326cc_library(
327 name = "configuration_for_rust",
328 srcs = [
329 "configuration_for_rust.cc",
330 ],
331 hdrs = [
332 "configuration_for_rust.h",
333 ],
334 deps = [
335 ":configuration",
336 ":for_rust",
Adam Snaider770b97b2023-08-04 21:07:48 -0700337 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700338 ],
339)
340
341autocxx_library(
342 name = "configuration_rs",
343 srcs = ["configuration.rs"],
344 crate_name = "aos_configuration",
345 libs = [
346 ":configuration",
347 ":configuration_for_rust",
348 ":configuration_fbs",
349 ],
350 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800351 test_data = [
352 "//aos/testdata:test_configs",
353 ],
James Kuszmaul1cd3c2b2024-05-21 17:08:10 -0700354 test_deps = [
355 "//aos/testing:path_rs",
356 ],
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700357 visibility = ["//visibility:public"],
358 deps = [
359 ":configuration_rust_fbs",
360 ":flatbuffers_rs",
Adam Snaider770b97b2023-08-04 21:07:48 -0700361 "@crate_index//:thiserror",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700362 ],
363)
364
James Kuszmaulabb77132020-08-01 19:56:16 -0700365flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800366 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700367 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800368 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700369 visibility = ["//aos:__subpackages__"],
370)
371
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700372flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800373 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700374 srcs = ["json_to_flatbuffer.fbs"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800375 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800376 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700377 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700378)
379
Brian Silvermand1805b62022-07-20 20:47:05 -0700380flatbuffer_rust_library(
381 name = "json_to_flatbuffer_rust_fbs",
382 srcs = ["json_to_flatbuffer.fbs"],
383 crate_name = "aos_json_to_flatbuffer_fbs",
Brian Silvermand1805b62022-07-20 20:47:05 -0700384 visibility = ["//aos:__subpackages__"],
385)
386
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700387cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700388 name = "flatbuffer_utils",
389 srcs = ["flatbuffer_utils.cc"],
390 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800391 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700392 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700393 deps = [
394 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800395 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700396 ],
397)
398
399cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700400 name = "json_tokenizer",
401 srcs = ["json_tokenizer.cc"],
402 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800403 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700404 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700405 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700406 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700407 "@com_google_absl//absl/strings",
408 ],
409)
410
411cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700412 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800413 srcs = [
414 "flatbuffer_introspection.cc",
415 "json_to_flatbuffer.cc",
416 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700417 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800418 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700419 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700420 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700421 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700422 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700423 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700424 ":json_tokenizer",
James Kuszmaulf5eb4682023-09-22 17:16:59 -0700425 "//aos/flatbuffers:builder",
Austin Schuhbba10282021-03-20 22:03:28 -0700426 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700427 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700428 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700429 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700430 ],
431)
432
433cc_test(
434 name = "json_to_flatbuffer_test",
435 srcs = [
436 "json_to_flatbuffer_test.cc",
437 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800438 data = [
439 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800440 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800441 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800442 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700443 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800444 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700445 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800446 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700447 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700448 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700449 ],
450)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700451
Tyler Chatow5e369a42019-11-23 11:57:31 -0800452cc_test(
453 name = "flatbuffer_introspection_test",
454 srcs = [
455 "flatbuffer_introspection_test.cc",
456 ],
457 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800458 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800459 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800460 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800461 deps = [
462 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800463 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800464 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700465 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800466 "//aos/util:file",
467 "@com_github_google_flatbuffers//:flatbuffers",
468 ],
469)
470
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700471cc_library(
472 name = "flatbuffer_merge",
473 srcs = ["flatbuffer_merge.cc"],
474 hdrs = ["flatbuffer_merge.h"],
475 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800476 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700477 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700478 deps = [
479 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700480 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700481 "@com_github_google_flatbuffers//:flatbuffers",
482 ],
483)
484
485cc_test(
486 name = "flatbuffer_merge_test",
487 srcs = [
488 "flatbuffer_merge_test.cc",
489 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800490 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700491 deps = [
492 ":flatbuffer_merge",
493 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800494 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700495 "//aos/testing:googletest",
496 ],
497)
Austin Schuhe93d8642019-10-13 15:27:07 -0700498
499cc_library(
500 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700501 srcs = [
502 "flatbuffers.cc",
503 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700504 hdrs = [
505 "flatbuffers.h",
506 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800507 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700508 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700509 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800510 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700511 "//aos/containers:resizeable_buffer",
Austin Schuh3c9f92c2024-04-30 17:56:42 -0700512 "//aos/ipc_lib:data_alignment",
davidjevans8b9b52f2021-09-17 08:57:30 -0700513 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700514 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700515 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700516 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800517 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700518 ],
519)
Austin Schuhcb108412019-10-13 16:09:54 -0700520
Brian Silvermand1805b62022-07-20 20:47:05 -0700521rust_library(
522 name = "flatbuffers_rs",
523 srcs = ["flatbuffers.rs"],
524 crate_name = "aos_flatbuffers",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800525 test_deps = [
526 ":json_to_flatbuffer_rust_fbs",
527 ],
Brian Silvermand1805b62022-07-20 20:47:05 -0700528 visibility = ["//visibility:public"],
529 deps = [
530 "@com_github_google_flatbuffers//rust",
531 ],
532)
533
Austin Schuhcb108412019-10-13 16:09:54 -0700534cc_test(
535 name = "configuration_test",
536 srcs = [
537 "configuration_test.cc",
538 ],
539 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700540 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700541 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700542 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700543 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700544 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800545 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700546 deps = [
547 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700548 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800549 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700550 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700551 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700552 "//aos/testing:test_logging",
553 ],
554)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700555
556cc_binary(
557 name = "config_flattener",
558 srcs = [
559 "config_flattener.cc",
560 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800561 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700562 visibility = ["//visibility:public"],
563 deps = [
564 ":configuration",
565 ":init",
566 "//aos/util:file",
567 "@com_github_google_glog//:glog",
568 ],
569)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800570
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800571cc_library(
572 name = "aos_cli_utils",
573 srcs = [
574 "aos_cli_utils.cc",
575 ],
576 hdrs = [
577 "aos_cli_utils.h",
578 ],
579 target_compatible_with = ["@platforms//os:linux"],
580 visibility = ["//visibility:public"],
581 deps = [
582 ":configuration",
583 "//aos:init",
584 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700585 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800586 "@com_github_google_glog//:glog",
587 ],
588)
589
Tyler Chatow5e369a42019-11-23 11:57:31 -0800590cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800591 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800592 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800593 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800594 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800595 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800596 visibility = ["//visibility:public"],
597 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800598 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800599 ":configuration",
600 ":json_to_flatbuffer",
601 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800602 "@com_github_google_glog//:glog",
603 ],
604)
605
606cc_binary(
Austin Schuh99004602024-03-16 11:59:24 -0700607 name = "aos_jitter",
608 srcs = [
609 "aos_jitter.cc",
610 ],
611 target_compatible_with = ["@platforms//os:linux"],
612 visibility = ["//visibility:public"],
613 deps = [
614 ":aos_cli_utils",
615 ":configuration",
616 ":init",
617 ":json_to_flatbuffer",
618 ":realtime",
619 "@com_github_google_glog//:glog",
620 ],
621)
622
623cc_binary(
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800624 name = "aos_send",
625 srcs = [
626 "aos_send.cc",
627 ],
628 target_compatible_with = ["@platforms//os:linux"],
629 visibility = ["//visibility:public"],
630 deps = [
631 ":aos_cli_utils",
632 ":configuration",
633 ":init",
634 ":json_to_flatbuffer",
635 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800636 "@com_github_google_glog//:glog",
637 ],
638)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500639
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700640cc_binary(
641 name = "aos_graph_nodes",
642 srcs = [
643 "aos_graph_nodes.cc",
644 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800645 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700646 visibility = ["//visibility:public"],
647 deps = [
648 ":configuration",
649 ":json_to_flatbuffer",
650 "//aos:init",
651 "//aos/events:shm_event_loop",
652 "@com_github_google_glog//:glog",
653 ],
654)
655
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500656cc_library(
657 name = "ftrace",
658 srcs = [
659 "ftrace.cc",
660 ],
661 hdrs = [
662 "ftrace.h",
663 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800664 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500665 visibility = ["//visibility:public"],
666 deps = [
667 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800668 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500669 ],
670)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700671
672cc_library(
673 name = "fast_string_builder",
674 srcs = [
675 "fast_string_builder.cc",
676 ],
677 hdrs = [
678 "fast_string_builder.h",
679 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800680 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700681 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700682 deps = [
683 "@com_github_google_glog//:glog",
684 "@com_google_absl//absl/strings",
685 "@com_google_absl//absl/strings:str_format",
686 ],
687)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700688
Austin Schuhcc6070c2020-10-10 20:25:56 -0700689cc_test(
690 name = "realtime_test",
691 srcs = [
692 "realtime_test.cc",
693 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800694 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700695 visibility = ["//visibility:public"],
696 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700697 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700698 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700699 "@com_github_gflags_gflags//:gflags",
700 "@com_github_google_glog//:glog",
701 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700702 ],
703)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800704
705cc_test(
706 name = "flatbuffers_test",
707 srcs = [
708 "flatbuffers_test.cc",
709 ],
710 deps = [
711 ":flatbuffers",
712 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800713 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800714 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700715 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800716 ],
717)
Austin Schuh0de30f32020-12-06 12:44:28 -0800718
719py_binary(
720 name = "flatbuffers_static",
721 srcs = ["flatbuffers_static.py"],
722 visibility = ["//visibility:public"],
723)
Austin Schuh4385b142021-03-14 21:31:13 -0700724
725cc_library(
726 name = "uuid",
727 srcs = ["uuid.cc"],
728 hdrs = ["uuid.h"],
729 target_compatible_with = ["@platforms//os:linux"],
730 visibility = ["//visibility:public"],
731 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700732 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700733 "@com_github_google_flatbuffers//:flatbuffers",
734 "@com_github_google_glog//:glog",
735 "@com_google_absl//absl/types:span",
736 ],
737)
738
739cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700740 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700741 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700742 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700743 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700744 target_compatible_with = ["@platforms//os:linux"],
745 deps = [
746 ":uuid",
747 "//aos/testing:googletest",
748 ],
749)
750
751cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700752 name = "uuid_test",
753 srcs = ["uuid_test.cc"],
754 target_compatible_with = ["@platforms//os:linux"],
755 deps = [
756 ":uuid",
757 "//aos/testing:googletest",
758 ],
759)
Austin Schuh30f74292021-08-13 17:25:26 -0700760
Brian Silverman10599932022-08-15 06:05:53 -0700761cc_library(
762 name = "uuid_for_rust",
763 hdrs = ["uuid_for_rust.h"],
764 deps = [
765 ":uuid",
766 ],
767)
768
769autocxx_library(
770 name = "uuid_rs",
771 srcs = ["uuid.rs"],
772 crate_name = "aos_uuid",
773 libs = [
774 ":uuid",
775 ":uuid_for_rust",
776 ],
777 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
778 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700779 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700780 ],
Brian Silverman10599932022-08-15 06:05:53 -0700781 visibility = ["//visibility:public"],
782)
783
Austin Schuh30f74292021-08-13 17:25:26 -0700784cc_binary(
785 name = "aos_graph_channels",
786 srcs = [
787 "aos_graph_channels.cc",
788 ],
789 target_compatible_with = ["@platforms//os:linux"],
790 deps = [
791 "//aos:configuration",
792 "//aos:init",
793 "//aos:json_to_flatbuffer",
794 "//aos/events:simulated_event_loop",
795 "//aos/events/logging:log_reader",
796 "//aos/time",
797 "@com_github_gflags_gflags//:gflags",
798 "@com_github_google_glog//:glog",
799 ],
800)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700801
802cc_library(
803 name = "for_rust",
804 hdrs = [
805 "for_rust.h",
806 ],
807 visibility = ["//visibility:public"],
808 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700809 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700810 ],
811)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700812
813cc_library(
814 name = "sha256",
815 srcs = [
816 "sha256.cc",
817 ],
818 hdrs = ["sha256.h"],
819 target_compatible_with = ["@platforms//os:linux"],
820 visibility = ["//visibility:public"],
821 deps = [
James Kuszmaul56802ab2023-08-23 15:18:34 -0700822 "//aos/util:file",
Austin Schuhb0e439d2023-05-15 10:55:40 -0700823 "@boringssl//:crypto",
824 "@com_google_absl//absl/types:span",
825 ],
826)
James Kuszmaul56802ab2023-08-23 15:18:34 -0700827
828cc_test(
829 name = "sha256_test",
830 srcs = ["sha256_test.cc"],
831 deps = [
832 ":sha256",
833 "//aos/testing:googletest",
834 "//aos/testing:tmpdir",
835 ],
836)
Adam Snaidercc622812023-11-07 17:59:27 -0800837
838rust_library(
839 name = "aos_rs",
840 srcs = ["aos.rs"],
841 crate_name = "aos",
842 visibility = ["//visibility:public"],
843 deps = [
844 ":configuration_rs",
845 ":flatbuffers_rs",
846 ":init_rs",
847 ":uuid_rs",
848 "//aos/events:event_loop_runtime",
849 "//aos/events:shm_event_loop_rs",
850 "//aos/events:simulated_event_loop_rs",
851 ],
852)