blob: de4ef4f5d4696844b5804158841f55132e83e3c5 [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",
davidjevans8b9b52f2021-09-17 08:57:30 -0700512 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700513 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700514 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700515 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800516 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700517 ],
518)
Austin Schuhcb108412019-10-13 16:09:54 -0700519
Brian Silvermand1805b62022-07-20 20:47:05 -0700520rust_library(
521 name = "flatbuffers_rs",
522 srcs = ["flatbuffers.rs"],
523 crate_name = "aos_flatbuffers",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800524 test_deps = [
525 ":json_to_flatbuffer_rust_fbs",
526 ],
Brian Silvermand1805b62022-07-20 20:47:05 -0700527 visibility = ["//visibility:public"],
528 deps = [
529 "@com_github_google_flatbuffers//rust",
530 ],
531)
532
Austin Schuhcb108412019-10-13 16:09:54 -0700533cc_test(
534 name = "configuration_test",
535 srcs = [
536 "configuration_test.cc",
537 ],
538 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700539 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700540 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700541 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700542 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700543 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800544 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700545 deps = [
546 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700547 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800548 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700549 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700550 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700551 "//aos/testing:test_logging",
552 ],
553)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700554
555cc_binary(
556 name = "config_flattener",
557 srcs = [
558 "config_flattener.cc",
559 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800560 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700561 visibility = ["//visibility:public"],
562 deps = [
563 ":configuration",
564 ":init",
565 "//aos/util:file",
566 "@com_github_google_glog//:glog",
567 ],
568)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800569
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800570cc_library(
571 name = "aos_cli_utils",
572 srcs = [
573 "aos_cli_utils.cc",
574 ],
575 hdrs = [
576 "aos_cli_utils.h",
577 ],
578 target_compatible_with = ["@platforms//os:linux"],
579 visibility = ["//visibility:public"],
580 deps = [
581 ":configuration",
582 "//aos:init",
583 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700584 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800585 "@com_github_google_glog//:glog",
586 ],
587)
588
Tyler Chatow5e369a42019-11-23 11:57:31 -0800589cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800590 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800591 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800592 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800593 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800594 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800595 visibility = ["//visibility:public"],
596 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800597 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800598 ":configuration",
599 ":json_to_flatbuffer",
600 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800601 "@com_github_google_glog//:glog",
602 ],
603)
604
605cc_binary(
Austin Schuh99004602024-03-16 11:59:24 -0700606 name = "aos_jitter",
607 srcs = [
608 "aos_jitter.cc",
609 ],
610 target_compatible_with = ["@platforms//os:linux"],
611 visibility = ["//visibility:public"],
612 deps = [
613 ":aos_cli_utils",
614 ":configuration",
615 ":init",
616 ":json_to_flatbuffer",
617 ":realtime",
618 "@com_github_google_glog//:glog",
619 ],
620)
621
622cc_binary(
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800623 name = "aos_send",
624 srcs = [
625 "aos_send.cc",
626 ],
627 target_compatible_with = ["@platforms//os:linux"],
628 visibility = ["//visibility:public"],
629 deps = [
630 ":aos_cli_utils",
631 ":configuration",
632 ":init",
633 ":json_to_flatbuffer",
634 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800635 "@com_github_google_glog//:glog",
636 ],
637)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500638
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700639cc_binary(
640 name = "aos_graph_nodes",
641 srcs = [
642 "aos_graph_nodes.cc",
643 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800644 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700645 visibility = ["//visibility:public"],
646 deps = [
647 ":configuration",
648 ":json_to_flatbuffer",
649 "//aos:init",
650 "//aos/events:shm_event_loop",
651 "@com_github_google_glog//:glog",
652 ],
653)
654
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500655cc_library(
656 name = "ftrace",
657 srcs = [
658 "ftrace.cc",
659 ],
660 hdrs = [
661 "ftrace.h",
662 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800663 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500664 visibility = ["//visibility:public"],
665 deps = [
666 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800667 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500668 ],
669)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700670
671cc_library(
672 name = "fast_string_builder",
673 srcs = [
674 "fast_string_builder.cc",
675 ],
676 hdrs = [
677 "fast_string_builder.h",
678 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800679 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700680 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700681 deps = [
682 "@com_github_google_glog//:glog",
683 "@com_google_absl//absl/strings",
684 "@com_google_absl//absl/strings:str_format",
685 ],
686)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700687
Austin Schuhcc6070c2020-10-10 20:25:56 -0700688cc_test(
689 name = "realtime_test",
690 srcs = [
691 "realtime_test.cc",
692 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800693 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700694 visibility = ["//visibility:public"],
695 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700696 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700697 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700698 "@com_github_gflags_gflags//:gflags",
699 "@com_github_google_glog//:glog",
700 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700701 ],
702)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800703
704cc_test(
705 name = "flatbuffers_test",
706 srcs = [
707 "flatbuffers_test.cc",
708 ],
709 deps = [
710 ":flatbuffers",
711 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800712 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800713 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700714 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800715 ],
716)
Austin Schuh0de30f32020-12-06 12:44:28 -0800717
718py_binary(
719 name = "flatbuffers_static",
720 srcs = ["flatbuffers_static.py"],
721 visibility = ["//visibility:public"],
722)
Austin Schuh4385b142021-03-14 21:31:13 -0700723
724cc_library(
725 name = "uuid",
726 srcs = ["uuid.cc"],
727 hdrs = ["uuid.h"],
728 target_compatible_with = ["@platforms//os:linux"],
729 visibility = ["//visibility:public"],
730 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700731 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700732 "@com_github_google_flatbuffers//:flatbuffers",
733 "@com_github_google_glog//:glog",
734 "@com_google_absl//absl/types:span",
735 ],
736)
737
738cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700739 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700740 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700741 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700742 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700743 target_compatible_with = ["@platforms//os:linux"],
744 deps = [
745 ":uuid",
746 "//aos/testing:googletest",
747 ],
748)
749
750cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700751 name = "uuid_test",
752 srcs = ["uuid_test.cc"],
753 target_compatible_with = ["@platforms//os:linux"],
754 deps = [
755 ":uuid",
756 "//aos/testing:googletest",
757 ],
758)
Austin Schuh30f74292021-08-13 17:25:26 -0700759
Brian Silverman10599932022-08-15 06:05:53 -0700760cc_library(
761 name = "uuid_for_rust",
762 hdrs = ["uuid_for_rust.h"],
763 deps = [
764 ":uuid",
765 ],
766)
767
768autocxx_library(
769 name = "uuid_rs",
770 srcs = ["uuid.rs"],
771 crate_name = "aos_uuid",
772 libs = [
773 ":uuid",
774 ":uuid_for_rust",
775 ],
776 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
777 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700778 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700779 ],
Brian Silverman10599932022-08-15 06:05:53 -0700780 visibility = ["//visibility:public"],
781)
782
Austin Schuh30f74292021-08-13 17:25:26 -0700783cc_binary(
784 name = "aos_graph_channels",
785 srcs = [
786 "aos_graph_channels.cc",
787 ],
788 target_compatible_with = ["@platforms//os:linux"],
789 deps = [
790 "//aos:configuration",
791 "//aos:init",
792 "//aos:json_to_flatbuffer",
793 "//aos/events:simulated_event_loop",
794 "//aos/events/logging:log_reader",
795 "//aos/time",
796 "@com_github_gflags_gflags//:gflags",
797 "@com_github_google_glog//:glog",
798 ],
799)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700800
801cc_library(
802 name = "for_rust",
803 hdrs = [
804 "for_rust.h",
805 ],
806 visibility = ["//visibility:public"],
807 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700808 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700809 ],
810)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700811
812cc_library(
813 name = "sha256",
814 srcs = [
815 "sha256.cc",
816 ],
817 hdrs = ["sha256.h"],
818 target_compatible_with = ["@platforms//os:linux"],
819 visibility = ["//visibility:public"],
820 deps = [
James Kuszmaul56802ab2023-08-23 15:18:34 -0700821 "//aos/util:file",
Austin Schuhb0e439d2023-05-15 10:55:40 -0700822 "@boringssl//:crypto",
823 "@com_google_absl//absl/types:span",
824 ],
825)
James Kuszmaul56802ab2023-08-23 15:18:34 -0700826
827cc_test(
828 name = "sha256_test",
829 srcs = ["sha256_test.cc"],
830 deps = [
831 ":sha256",
832 "//aos/testing:googletest",
833 "//aos/testing:tmpdir",
834 ],
835)
Adam Snaidercc622812023-11-07 17:59:27 -0800836
837rust_library(
838 name = "aos_rs",
839 srcs = ["aos.rs"],
840 crate_name = "aos",
841 visibility = ["//visibility:public"],
842 deps = [
843 ":configuration_rs",
844 ":flatbuffers_rs",
845 ":init_rs",
846 ":uuid_rs",
847 "//aos/events:event_loop_runtime",
848 "//aos/events:shm_event_loop_rs",
849 "//aos/events:simulated_event_loop_rs",
850 ],
851)