blob: 38f3cf6efe93698467af481dc0bf47d408778e8c [file] [log] [blame]
Adam Snaider0967b812023-11-02 15:29:43 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library")
James Kuszmaulf01da392023-12-14 11:22:14 -08002load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
Austin Schuha1d006e2022-09-14 21:50:42 -07003load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
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")
Adam Snaiderf560ae92023-11-07 17:06:21 -08006load("//tools/rust:defs.bzl", "flatbuffer_rust_library", "rust_library")
Austin Schuh972e47e2018-12-20 17:20:58 -08007
Austin Schuh00e302a2020-12-21 11:53:30 -08008exports_files(["aos_dump_autocomplete.sh"])
9
Brian Silverman258b9172015-09-19 14:32:57 -040010filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070011 name = "prime_binaries",
12 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080013 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070014 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080015 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080016 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070017 ],
18 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080019)
Austin Schuhc80dd152016-02-29 01:47:44 -080020
21filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070022 name = "prime_start_binaries",
23 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080024 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070025 ],
26 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080027)
Brian Silverman6470f442018-08-05 12:08:16 -070028
Austin Schuhc80dd152016-02-29 01:47:44 -080029filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070030 name = "prime_binaries_stripped",
31 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080032 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070033 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080034 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070035 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070036 ],
37 visibility = ["//visibility:public"],
38)
39
40filegroup(
41 name = "prime_start_binaries_stripped",
42 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080043 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070044 ],
45 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080046)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070047
48cc_library(
John Park33858a32018-09-28 23:05:48 -070049 name = "math",
50 hdrs = [
51 "commonmath.h",
52 ],
John Park33858a32018-09-28 23:05:48 -070053 visibility = ["//visibility:public"],
54)
55
Brian Silverman6470f442018-08-05 12:08:16 -070056py_library(
57 name = "python_init",
58 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080059 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070060 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070061)
John Park33858a32018-09-28 23:05:48 -070062
63cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080064 name = "macros",
65 hdrs = [
John Park33858a32018-09-28 23:05:48 -070066 "macros.h",
John Park33858a32018-09-28 23:05:48 -070067 ],
68 visibility = ["//visibility:public"],
69)
70
71cc_library(
72 name = "gtest_prod",
73 hdrs = [
74 "gtest_prod.h",
75 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080076 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070077 visibility = ["//visibility:public"],
78)
79
80cc_library(
John Park33858a32018-09-28 23:05:48 -070081 name = "unique_malloc_ptr",
82 hdrs = [
83 "unique_malloc_ptr.h",
84 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080085 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070086 visibility = ["//visibility:public"],
87)
88
89cc_library(
90 name = "condition",
91 srcs = [
92 "condition.cc",
93 ],
94 hdrs = [
95 "condition.h",
96 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080097 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070098 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -080099 deps = [
100 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -0800101 "//aos/mutex",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700102 "@com_github_google_glog//:glog",
Austin Schuh972e47e2018-12-20 17:20:58 -0800103 ],
John Park33858a32018-09-28 23:05:48 -0700104)
105
106cc_test(
107 name = "condition_test",
108 srcs = [
109 "condition_test.cc",
110 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800111 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700112 deps = [
113 ":condition",
114 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700115 "//aos/ipc_lib:aos_sync",
116 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800117 "//aos/logging",
118 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700119 "//aos/testing:googletest",
120 "//aos/testing:prevent_exit",
121 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800122 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700123 ],
124)
125
126cc_library(
127 name = "die",
128 srcs = [
129 "die.cc",
130 ],
131 hdrs = [
132 "die.h",
133 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800134 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800135 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700136 deps = [
137 "//aos:macros",
138 "//aos/libc:aos_strerror",
139 ],
John Park33858a32018-09-28 23:05:48 -0700140)
141
John Park33858a32018-09-28 23:05:48 -0700142cc_test(
143 name = "die_test",
144 srcs = [
145 "die_test.cc",
146 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800147 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700148 deps = [
149 ":die",
150 "//aos/testing:googletest",
151 ],
152)
153
John Park398c74a2018-10-20 21:17:39 -0700154cc_binary(
155 name = "dump_rtprio",
156 srcs = [
157 "dump_rtprio.cc",
158 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800159 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700160 deps = [
Austin Schuh14056182023-01-03 21:19:38 -0800161 "//aos:init",
162 "//aos/events:shm_event_loop",
Austin Schuh972e47e2018-12-20 17:20:58 -0800163 "//aos/time",
Austin Schuh14056182023-01-03 21:19:38 -0800164 "//aos/util:top",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700165 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700166 ],
167)
168
169cc_library(
John Park398c74a2018-10-20 21:17:39 -0700170 name = "init",
171 srcs = [
172 "init.cc",
173 ],
174 hdrs = [
175 "init.h",
176 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800177 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800178 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700179 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700180 ":realtime",
James Kuszmaula791b762023-07-13 14:56:21 -0700181 ":uuid",
John Park398c74a2018-10-20 21:17:39 -0700182 "//aos:die",
Austin Schuhfc0caa82023-08-25 14:25:03 -0700183 "//aos/logging",
John Park398c74a2018-10-20 21:17:39 -0700184 ],
John Park398c74a2018-10-20 21:17:39 -0700185)
186
Adam Snaider48a62f32023-10-02 15:49:23 -0700187cc_library(
188 name = "init_for_rust",
189 srcs = [
190 "init_for_rust.cc",
191 ],
192 hdrs = [
193 "init_for_rust.h",
194 ],
195 deps = [
196 ":for_rust",
197 ":init",
198 "//aos/logging",
199 "@com_github_gflags_gflags//:gflags",
200 "@crate_index//:cxx_cc",
201 ],
202)
203
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700204autocxx_library(
205 name = "init_rs",
206 srcs = ["init.rs"],
207 crate_name = "aos_init",
208 libs = [
Adam Snaider48a62f32023-10-02 15:49:23 -0700209 ":init_for_rust",
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700210 ],
211 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700212 visibility = ["//visibility:public"],
Adam Snaider48a62f32023-10-02 15:49:23 -0700213 deps = [
214 "@crate_index//:clap",
215 ],
216)
217
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700218autocxx_library(
219 name = "test_init_rs",
220 testonly = True,
221 srcs = ["test_init.rs"],
222 crate_name = "aos_test_init",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800223 gen_docs = False,
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700224 libs = [
225 "//aos/testing:tmpdir",
226 ],
227 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700228 visibility = ["//visibility:public"],
229 deps = [
230 ":init_rs",
231 ],
232)
233
Alex Perrycb7da4b2019-08-28 19:35:56 -0700234cc_library(
235 name = "realtime",
236 srcs = [
237 "realtime.cc",
238 ],
239 hdrs = [
240 "realtime.h",
241 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800242 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700243 visibility = ["//visibility:public"],
244 deps = [
James Kuszmaula791b762023-07-13 14:56:21 -0700245 ":uuid",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700246 "@com_github_google_glog//:glog",
247 ],
248)
249
James Kuszmaulf01da392023-12-14 11:22:14 -0800250static_flatbuffer(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700251 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700252 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800253 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700254 visibility = ["//visibility:public"],
James Kuszmaul1e57af92023-12-20 15:34:54 -0800255 deps = ["//aos/flatbuffers/reflection:reflection_fbs"],
Austin Schuhcb108412019-10-13 16:09:54 -0700256)
257
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700258cc_static_flatbuffer(
259 name = "configuration_schema",
260 function = "aos::ConfigurationSchema",
261 target = ":configuration_fbs_reflection_out",
262 visibility = ["//visibility:public"],
263)
264
Alex Perryd5e13572020-02-22 15:15:08 -0800265flatbuffer_ts_library(
266 name = "configuration_ts_fbs",
267 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800268 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800269 visibility = ["//visibility:public"],
270)
271
Brian Silverman28760272020-02-02 13:21:51 -0800272flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800273 name = "configuration_fbs_python",
274 srcs = ["configuration.fbs"],
275 namespace = "aos",
276 tables = [
277 "Configuration",
278 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800279 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800280 "Map",
281 "Node",
282 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800283 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800284 visibility = ["//visibility:public"],
285)
286
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700287flatbuffer_rust_library(
288 name = "configuration_rust_fbs",
289 srcs = ["configuration.fbs"],
290 crate_name = "aos_configuration_fbs",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700291 visibility = ["//visibility:public"],
292)
293
John Park398c74a2018-10-20 21:17:39 -0700294cc_library(
295 name = "configuration",
296 srcs = [
297 "configuration.cc",
298 ],
299 hdrs = [
300 "configuration.h",
301 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800302 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800303 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700304 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700305 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700306 ":flatbuffer_merge",
307 ":flatbuffers",
308 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700309 "//aos:unique_malloc_ptr",
Austin Schuh83cbb1e2023-06-23 12:59:02 -0700310 "//aos/ipc_lib:index",
Austin Schuh217a9782019-12-21 23:02:50 -0800311 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700312 "//aos/util:file",
313 "@com_github_google_glog//:glog",
314 "@com_google_absl//absl/container:btree",
315 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700316 ],
John Park398c74a2018-10-20 21:17:39 -0700317)
318
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700319cc_library(
320 name = "configuration_for_rust",
321 srcs = [
322 "configuration_for_rust.cc",
323 ],
324 hdrs = [
325 "configuration_for_rust.h",
326 ],
327 deps = [
328 ":configuration",
329 ":for_rust",
Adam Snaider770b97b2023-08-04 21:07:48 -0700330 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700331 ],
332)
333
334autocxx_library(
335 name = "configuration_rs",
336 srcs = ["configuration.rs"],
337 crate_name = "aos_configuration",
338 libs = [
339 ":configuration",
340 ":configuration_for_rust",
341 ":configuration_fbs",
342 ],
343 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800344 test_data = [
345 "//aos/testdata:test_configs",
346 ],
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700347 visibility = ["//visibility:public"],
348 deps = [
349 ":configuration_rust_fbs",
350 ":flatbuffers_rs",
Adam Snaider770b97b2023-08-04 21:07:48 -0700351 "@crate_index//:thiserror",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700352 ],
353)
354
James Kuszmaulabb77132020-08-01 19:56:16 -0700355flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800356 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700357 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800358 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700359 visibility = ["//aos:__subpackages__"],
360)
361
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700362flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800363 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700364 srcs = ["json_to_flatbuffer.fbs"],
James Kuszmaulf01da392023-12-14 11:22:14 -0800365 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800366 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700367 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700368)
369
Brian Silvermand1805b62022-07-20 20:47:05 -0700370flatbuffer_rust_library(
371 name = "json_to_flatbuffer_rust_fbs",
372 srcs = ["json_to_flatbuffer.fbs"],
373 crate_name = "aos_json_to_flatbuffer_fbs",
Brian Silvermand1805b62022-07-20 20:47:05 -0700374 visibility = ["//aos:__subpackages__"],
375)
376
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700377cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700378 name = "flatbuffer_utils",
379 srcs = ["flatbuffer_utils.cc"],
380 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800381 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700382 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700383 deps = [
384 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800385 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700386 ],
387)
388
389cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700390 name = "json_tokenizer",
391 srcs = ["json_tokenizer.cc"],
392 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800393 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700394 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700395 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700396 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700397 "@com_google_absl//absl/strings",
398 ],
399)
400
401cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700402 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800403 srcs = [
404 "flatbuffer_introspection.cc",
405 "json_to_flatbuffer.cc",
406 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700407 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800408 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700409 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700410 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700411 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700412 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700413 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700414 ":json_tokenizer",
James Kuszmaulf5eb4682023-09-22 17:16:59 -0700415 "//aos/flatbuffers:builder",
Austin Schuhbba10282021-03-20 22:03:28 -0700416 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700417 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700418 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700419 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700420 ],
421)
422
423cc_test(
424 name = "json_to_flatbuffer_test",
425 srcs = [
426 "json_to_flatbuffer_test.cc",
427 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800428 data = [
429 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800430 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800431 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800432 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700433 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800434 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700435 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800436 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700437 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700438 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700439 ],
440)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700441
Tyler Chatow5e369a42019-11-23 11:57:31 -0800442cc_test(
443 name = "flatbuffer_introspection_test",
444 srcs = [
445 "flatbuffer_introspection_test.cc",
446 ],
447 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800448 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800449 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800450 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800451 deps = [
452 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800453 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800454 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700455 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800456 "//aos/util:file",
457 "@com_github_google_flatbuffers//:flatbuffers",
458 ],
459)
460
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700461cc_library(
462 name = "flatbuffer_merge",
463 srcs = ["flatbuffer_merge.cc"],
464 hdrs = ["flatbuffer_merge.h"],
465 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800466 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700467 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700468 deps = [
469 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700470 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700471 "@com_github_google_flatbuffers//:flatbuffers",
472 ],
473)
474
475cc_test(
476 name = "flatbuffer_merge_test",
477 srcs = [
478 "flatbuffer_merge_test.cc",
479 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800480 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700481 deps = [
482 ":flatbuffer_merge",
483 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800484 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700485 "//aos/testing:googletest",
486 ],
487)
Austin Schuhe93d8642019-10-13 15:27:07 -0700488
489cc_library(
490 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700491 srcs = [
492 "flatbuffers.cc",
493 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700494 hdrs = [
495 "flatbuffers.h",
496 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800497 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700498 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700499 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800500 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700501 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700502 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700503 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700504 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700505 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800506 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700507 ],
508)
Austin Schuhcb108412019-10-13 16:09:54 -0700509
Brian Silvermand1805b62022-07-20 20:47:05 -0700510rust_library(
511 name = "flatbuffers_rs",
512 srcs = ["flatbuffers.rs"],
513 crate_name = "aos_flatbuffers",
Adam Snaiderf560ae92023-11-07 17:06:21 -0800514 test_deps = [
515 ":json_to_flatbuffer_rust_fbs",
516 ],
Brian Silvermand1805b62022-07-20 20:47:05 -0700517 visibility = ["//visibility:public"],
518 deps = [
519 "@com_github_google_flatbuffers//rust",
520 ],
521)
522
Austin Schuhcb108412019-10-13 16:09:54 -0700523cc_test(
524 name = "configuration_test",
525 srcs = [
526 "configuration_test.cc",
527 ],
528 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700529 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700530 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700531 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700532 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700533 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800534 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700535 deps = [
536 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700537 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800538 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700539 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700540 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700541 "//aos/testing:test_logging",
542 ],
543)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700544
545cc_binary(
546 name = "config_flattener",
547 srcs = [
548 "config_flattener.cc",
549 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800550 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700551 visibility = ["//visibility:public"],
552 deps = [
553 ":configuration",
554 ":init",
555 "//aos/util:file",
556 "@com_github_google_glog//:glog",
557 ],
558)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800559
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800560cc_library(
561 name = "aos_cli_utils",
562 srcs = [
563 "aos_cli_utils.cc",
564 ],
565 hdrs = [
566 "aos_cli_utils.h",
567 ],
568 target_compatible_with = ["@platforms//os:linux"],
569 visibility = ["//visibility:public"],
570 deps = [
571 ":configuration",
572 "//aos:init",
573 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700574 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800575 "@com_github_google_glog//:glog",
576 ],
577)
578
Tyler Chatow5e369a42019-11-23 11:57:31 -0800579cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800580 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800581 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800582 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800583 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800584 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800585 visibility = ["//visibility:public"],
586 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800587 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800588 ":configuration",
589 ":json_to_flatbuffer",
590 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800591 "@com_github_google_glog//:glog",
592 ],
593)
594
595cc_binary(
596 name = "aos_send",
597 srcs = [
598 "aos_send.cc",
599 ],
600 target_compatible_with = ["@platforms//os:linux"],
601 visibility = ["//visibility:public"],
602 deps = [
603 ":aos_cli_utils",
604 ":configuration",
605 ":init",
606 ":json_to_flatbuffer",
607 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800608 "@com_github_google_glog//:glog",
609 ],
610)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500611
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700612cc_binary(
613 name = "aos_graph_nodes",
614 srcs = [
615 "aos_graph_nodes.cc",
616 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800617 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700618 visibility = ["//visibility:public"],
619 deps = [
620 ":configuration",
621 ":json_to_flatbuffer",
622 "//aos:init",
623 "//aos/events:shm_event_loop",
624 "@com_github_google_glog//:glog",
625 ],
626)
627
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500628cc_library(
629 name = "ftrace",
630 srcs = [
631 "ftrace.cc",
632 ],
633 hdrs = [
634 "ftrace.h",
635 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800636 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500637 visibility = ["//visibility:public"],
638 deps = [
639 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800640 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500641 ],
642)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700643
644cc_library(
645 name = "fast_string_builder",
646 srcs = [
647 "fast_string_builder.cc",
648 ],
649 hdrs = [
650 "fast_string_builder.h",
651 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800652 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700653 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700654 deps = [
655 "@com_github_google_glog//:glog",
656 "@com_google_absl//absl/strings",
657 "@com_google_absl//absl/strings:str_format",
658 ],
659)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700660
Austin Schuhcc6070c2020-10-10 20:25:56 -0700661cc_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 Schuh8902fa52021-03-14 22:39:24 -0700704 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700705 "@com_github_google_flatbuffers//:flatbuffers",
706 "@com_github_google_glog//:glog",
707 "@com_google_absl//absl/types:span",
708 ],
709)
710
711cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700712 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700713 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700714 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700715 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700716 target_compatible_with = ["@platforms//os:linux"],
717 deps = [
718 ":uuid",
719 "//aos/testing:googletest",
720 ],
721)
722
723cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700724 name = "uuid_test",
725 srcs = ["uuid_test.cc"],
726 target_compatible_with = ["@platforms//os:linux"],
727 deps = [
728 ":uuid",
729 "//aos/testing:googletest",
730 ],
731)
Austin Schuh30f74292021-08-13 17:25:26 -0700732
Brian Silverman10599932022-08-15 06:05:53 -0700733cc_library(
734 name = "uuid_for_rust",
735 hdrs = ["uuid_for_rust.h"],
736 deps = [
737 ":uuid",
738 ],
739)
740
741autocxx_library(
742 name = "uuid_rs",
743 srcs = ["uuid.rs"],
744 crate_name = "aos_uuid",
745 libs = [
746 ":uuid",
747 ":uuid_for_rust",
748 ],
749 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
750 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700751 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700752 ],
Brian Silverman10599932022-08-15 06:05:53 -0700753 visibility = ["//visibility:public"],
754)
755
Austin Schuh30f74292021-08-13 17:25:26 -0700756cc_binary(
757 name = "aos_graph_channels",
758 srcs = [
759 "aos_graph_channels.cc",
760 ],
761 target_compatible_with = ["@platforms//os:linux"],
762 deps = [
763 "//aos:configuration",
764 "//aos:init",
765 "//aos:json_to_flatbuffer",
766 "//aos/events:simulated_event_loop",
767 "//aos/events/logging:log_reader",
768 "//aos/time",
769 "@com_github_gflags_gflags//:gflags",
770 "@com_github_google_glog//:glog",
771 ],
772)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700773
774cc_library(
775 name = "for_rust",
776 hdrs = [
777 "for_rust.h",
778 ],
779 visibility = ["//visibility:public"],
780 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700781 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700782 ],
783)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700784
785cc_library(
786 name = "sha256",
787 srcs = [
788 "sha256.cc",
789 ],
790 hdrs = ["sha256.h"],
791 target_compatible_with = ["@platforms//os:linux"],
792 visibility = ["//visibility:public"],
793 deps = [
James Kuszmaul56802ab2023-08-23 15:18:34 -0700794 "//aos/util:file",
Austin Schuhb0e439d2023-05-15 10:55:40 -0700795 "@boringssl//:crypto",
796 "@com_google_absl//absl/types:span",
797 ],
798)
James Kuszmaul56802ab2023-08-23 15:18:34 -0700799
800cc_test(
801 name = "sha256_test",
802 srcs = ["sha256_test.cc"],
803 deps = [
804 ":sha256",
805 "//aos/testing:googletest",
806 "//aos/testing:tmpdir",
807 ],
808)