blob: acef7624dc80aab43e28a31cdd3211c0cc6adcfb [file] [log] [blame]
Austin Schuha1d006e2022-09-14 21:50:42 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library", "flatbuffer_rust_library")
2load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Brian Silvermand1805b62022-07-20 20:47:05 -07003load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
James Kuszmaule4aa01d2022-06-28 14:09:02 -07004load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
Brian Silverman7edd1ce2022-07-23 16:10:54 -07005load("//tools/build_rules:autocxx.bzl", "autocxx_library")
Austin Schuh972e47e2018-12-20 17:20:58 -08006
Austin Schuh00e302a2020-12-21 11:53:30 -08007exports_files(["aos_dump_autocomplete.sh"])
8
Brian Silverman258b9172015-09-19 14:32:57 -04009filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070010 name = "prime_binaries",
11 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080012 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070013 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080014 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080015 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070016 ],
17 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080018)
Austin Schuhc80dd152016-02-29 01:47:44 -080019
20filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070021 name = "prime_start_binaries",
22 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080023 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070024 ],
25 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080026)
Brian Silverman6470f442018-08-05 12:08:16 -070027
Austin Schuhc80dd152016-02-29 01:47:44 -080028filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070029 name = "prime_binaries_stripped",
30 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080031 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070032 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080033 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070034 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070035 ],
36 visibility = ["//visibility:public"],
37)
38
39filegroup(
40 name = "prime_start_binaries_stripped",
41 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080042 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070043 ],
44 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080045)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070046
47cc_library(
John Park33858a32018-09-28 23:05:48 -070048 name = "math",
49 hdrs = [
50 "commonmath.h",
51 ],
John Park33858a32018-09-28 23:05:48 -070052 visibility = ["//visibility:public"],
53)
54
Brian Silverman6470f442018-08-05 12:08:16 -070055py_library(
56 name = "python_init",
57 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080058 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070059 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070060)
John Park33858a32018-09-28 23:05:48 -070061
62cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080063 name = "macros",
64 hdrs = [
John Park33858a32018-09-28 23:05:48 -070065 "macros.h",
John Park33858a32018-09-28 23:05:48 -070066 ],
67 visibility = ["//visibility:public"],
68)
69
70cc_library(
71 name = "gtest_prod",
72 hdrs = [
73 "gtest_prod.h",
74 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070076 visibility = ["//visibility:public"],
77)
78
79cc_library(
John Park33858a32018-09-28 23:05:48 -070080 name = "unique_malloc_ptr",
81 hdrs = [
82 "unique_malloc_ptr.h",
83 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080084 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070085 visibility = ["//visibility:public"],
86)
87
88cc_library(
89 name = "condition",
90 srcs = [
91 "condition.cc",
92 ],
93 hdrs = [
94 "condition.h",
95 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080096 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070097 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -080098 deps = [
99 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -0800100 "//aos/mutex",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700101 "@com_github_google_glog//:glog",
Austin Schuh972e47e2018-12-20 17:20:58 -0800102 ],
John Park33858a32018-09-28 23:05:48 -0700103)
104
105cc_test(
106 name = "condition_test",
107 srcs = [
108 "condition_test.cc",
109 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800110 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700111 deps = [
112 ":condition",
113 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700114 "//aos/ipc_lib:aos_sync",
115 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800116 "//aos/logging",
117 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700118 "//aos/testing:googletest",
119 "//aos/testing:prevent_exit",
120 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800121 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700122 ],
123)
124
125cc_library(
126 name = "die",
127 srcs = [
128 "die.cc",
129 ],
130 hdrs = [
131 "die.h",
132 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800133 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800134 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700135 deps = [
136 "//aos:macros",
137 "//aos/libc:aos_strerror",
138 ],
John Park33858a32018-09-28 23:05:48 -0700139)
140
John Park33858a32018-09-28 23:05:48 -0700141cc_test(
142 name = "die_test",
143 srcs = [
144 "die_test.cc",
145 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800146 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700147 deps = [
148 ":die",
149 "//aos/testing:googletest",
150 ],
151)
152
John Park398c74a2018-10-20 21:17:39 -0700153cc_binary(
154 name = "dump_rtprio",
155 srcs = [
156 "dump_rtprio.cc",
157 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800158 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700159 deps = [
Austin Schuh14056182023-01-03 21:19:38 -0800160 "//aos:init",
161 "//aos/events:shm_event_loop",
Austin Schuh972e47e2018-12-20 17:20:58 -0800162 "//aos/time",
Austin Schuh14056182023-01-03 21:19:38 -0800163 "//aos/util:top",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700164 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700165 ],
166)
167
168cc_library(
John Park398c74a2018-10-20 21:17:39 -0700169 name = "init",
170 srcs = [
171 "init.cc",
172 ],
173 hdrs = [
174 "init.h",
175 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800176 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800177 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700178 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700179 ":realtime",
James Kuszmaula791b762023-07-13 14:56:21 -0700180 ":uuid",
John Park398c74a2018-10-20 21:17:39 -0700181 "//aos:die",
Austin Schuhfc0caa82023-08-25 14:25:03 -0700182 "//aos/logging",
John Park398c74a2018-10-20 21:17:39 -0700183 ],
John Park398c74a2018-10-20 21:17:39 -0700184)
185
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700186autocxx_library(
187 name = "init_rs",
188 srcs = ["init.rs"],
189 crate_name = "aos_init",
190 libs = [
191 ":init",
192 ],
193 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700194 target_compatible_with = select({
195 "//conditions:default": ["//tools/platforms/rust:has_support"],
196 "//tools:has_msan": ["@platforms//:incompatible"],
197 }),
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700198 visibility = ["//visibility:public"],
199)
200
Adam Snaiderc8b7e752023-09-14 14:27:53 -0700201autocxx_library(
202 name = "test_init_rs",
203 testonly = True,
204 srcs = ["test_init.rs"],
205 crate_name = "aos_test_init",
206 libs = [
207 "//aos/testing:tmpdir",
208 ],
209 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
210 target_compatible_with = select({
211 "//conditions:default": ["//tools/platforms/rust:has_support"],
212 "//tools:has_msan": ["@platforms//:incompatible"],
213 }),
214 visibility = ["//visibility:public"],
215 deps = [
216 ":init_rs",
217 ],
218)
219
Alex Perrycb7da4b2019-08-28 19:35:56 -0700220cc_library(
221 name = "realtime",
222 srcs = [
223 "realtime.cc",
224 ],
225 hdrs = [
226 "realtime.h",
227 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800228 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700229 visibility = ["//visibility:public"],
230 deps = [
James Kuszmaula791b762023-07-13 14:56:21 -0700231 ":uuid",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700232 "@com_github_google_glog//:glog",
233 ],
234)
235
Austin Schuhcb108412019-10-13 16:09:54 -0700236flatbuffer_cc_library(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700237 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700238 srcs = ["configuration.fbs"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700239 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800240 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700241 visibility = ["//visibility:public"],
Austin Schuhcb108412019-10-13 16:09:54 -0700242)
243
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700244cc_static_flatbuffer(
245 name = "configuration_schema",
246 function = "aos::ConfigurationSchema",
247 target = ":configuration_fbs_reflection_out",
248 visibility = ["//visibility:public"],
249)
250
Alex Perryd5e13572020-02-22 15:15:08 -0800251flatbuffer_ts_library(
252 name = "configuration_ts_fbs",
253 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800254 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800255 visibility = ["//visibility:public"],
256)
257
Brian Silverman28760272020-02-02 13:21:51 -0800258flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800259 name = "configuration_fbs_python",
260 srcs = ["configuration.fbs"],
261 namespace = "aos",
262 tables = [
263 "Configuration",
264 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800265 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800266 "Map",
267 "Node",
268 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800269 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800270 visibility = ["//visibility:public"],
271)
272
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700273flatbuffer_rust_library(
274 name = "configuration_rust_fbs",
275 srcs = ["configuration.fbs"],
276 crate_name = "aos_configuration_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700277 target_compatible_with = select({
278 "//conditions:default": ["//tools/platforms/rust:has_support"],
279 "//tools:has_msan": ["@platforms//:incompatible"],
280 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700281 visibility = ["//visibility:public"],
282)
283
John Park398c74a2018-10-20 21:17:39 -0700284cc_library(
285 name = "configuration",
286 srcs = [
287 "configuration.cc",
288 ],
289 hdrs = [
290 "configuration.h",
291 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800292 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800293 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700294 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700295 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700296 ":flatbuffer_merge",
297 ":flatbuffers",
298 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700299 "//aos:unique_malloc_ptr",
Austin Schuh83cbb1e2023-06-23 12:59:02 -0700300 "//aos/ipc_lib:index",
Austin Schuh217a9782019-12-21 23:02:50 -0800301 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700302 "//aos/util:file",
303 "@com_github_google_glog//:glog",
304 "@com_google_absl//absl/container:btree",
305 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700306 ],
John Park398c74a2018-10-20 21:17:39 -0700307)
308
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700309cc_library(
310 name = "configuration_for_rust",
311 srcs = [
312 "configuration_for_rust.cc",
313 ],
314 hdrs = [
315 "configuration_for_rust.h",
316 ],
317 deps = [
318 ":configuration",
319 ":for_rust",
Adam Snaider770b97b2023-08-04 21:07:48 -0700320 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700321 ],
322)
323
324autocxx_library(
325 name = "configuration_rs",
326 srcs = ["configuration.rs"],
327 crate_name = "aos_configuration",
328 libs = [
329 ":configuration",
330 ":configuration_for_rust",
331 ":configuration_fbs",
332 ],
333 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700334 target_compatible_with = select({
335 "//conditions:default": ["//tools/platforms/rust:has_support"],
336 "//tools:has_msan": ["@platforms//:incompatible"],
337 }),
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700338 visibility = ["//visibility:public"],
339 deps = [
340 ":configuration_rust_fbs",
341 ":flatbuffers_rs",
Adam Snaider770b97b2023-08-04 21:07:48 -0700342 "@crate_index//:thiserror",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700343 ],
344)
345
346rust_test(
347 name = "configuration_rs_test",
348 crate = ":configuration_rs",
349 data = [
350 "//aos/testdata:test_configs",
351 ],
352 # TODO: Make Rust play happy with pic vs nopic. Details at:
353 # https://github.com/bazelbuild/rules_rust/issues/118
354 rustc_flags = ["-Crelocation-model=static"],
355)
356
James Kuszmaulabb77132020-08-01 19:56:16 -0700357flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800358 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700359 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800360 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700361 visibility = ["//aos:__subpackages__"],
362)
363
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700364flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800365 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700366 srcs = ["json_to_flatbuffer.fbs"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800367 gen_reflections = 1,
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__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700370)
371
Brian Silvermand1805b62022-07-20 20:47:05 -0700372flatbuffer_rust_library(
373 name = "json_to_flatbuffer_rust_fbs",
374 srcs = ["json_to_flatbuffer.fbs"],
375 crate_name = "aos_json_to_flatbuffer_fbs",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700376 target_compatible_with = select({
377 "//conditions:default": ["//tools/platforms/rust:has_support"],
378 "//tools:has_msan": ["@platforms//:incompatible"],
379 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700380 visibility = ["//aos:__subpackages__"],
381)
382
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700383cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700384 name = "flatbuffer_utils",
385 srcs = ["flatbuffer_utils.cc"],
386 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800387 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700388 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700389 deps = [
390 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800391 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700392 ],
393)
394
395cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700396 name = "json_tokenizer",
397 srcs = ["json_tokenizer.cc"],
398 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800399 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700400 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700401 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700402 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700403 "@com_google_absl//absl/strings",
404 ],
405)
406
407cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700408 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800409 srcs = [
410 "flatbuffer_introspection.cc",
411 "json_to_flatbuffer.cc",
412 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700413 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800414 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700415 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700416 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700417 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700418 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700419 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700420 ":json_tokenizer",
Austin Schuhbba10282021-03-20 22:03:28 -0700421 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700422 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700423 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700424 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700425 ],
426)
427
428cc_test(
429 name = "json_to_flatbuffer_test",
430 srcs = [
431 "json_to_flatbuffer_test.cc",
432 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800433 data = [
434 ":json_to_flatbuffer_fbs_reflection_out",
Alexander Yeee61cac32023-02-11 19:40:40 -0800435 ":json_to_flatbuffer_test_spaces.json",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800436 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800437 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700438 deps = [
Alexander Yeee61cac32023-02-11 19:40:40 -0800439 ":flatbuffer_merge",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700440 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800441 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700442 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700443 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700444 ],
445)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700446
Tyler Chatow5e369a42019-11-23 11:57:31 -0800447cc_test(
448 name = "flatbuffer_introspection_test",
449 srcs = [
450 "flatbuffer_introspection_test.cc",
451 ],
452 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800453 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800454 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800455 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800456 deps = [
457 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800458 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800459 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700460 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800461 "//aos/util:file",
462 "@com_github_google_flatbuffers//:flatbuffers",
463 ],
464)
465
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700466cc_library(
467 name = "flatbuffer_merge",
468 srcs = ["flatbuffer_merge.cc"],
469 hdrs = ["flatbuffer_merge.h"],
470 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800471 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700472 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700473 deps = [
474 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700475 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700476 "@com_github_google_flatbuffers//:flatbuffers",
477 ],
478)
479
480cc_test(
481 name = "flatbuffer_merge_test",
482 srcs = [
483 "flatbuffer_merge_test.cc",
484 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800485 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700486 deps = [
487 ":flatbuffer_merge",
488 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800489 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700490 "//aos/testing:googletest",
491 ],
492)
Austin Schuhe93d8642019-10-13 15:27:07 -0700493
494cc_library(
495 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700496 srcs = [
497 "flatbuffers.cc",
498 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700499 hdrs = [
500 "flatbuffers.h",
501 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800502 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700503 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700504 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800505 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700506 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700507 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700508 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700509 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700510 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800511 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700512 ],
513)
Austin Schuhcb108412019-10-13 16:09:54 -0700514
Brian Silvermand1805b62022-07-20 20:47:05 -0700515rust_library(
516 name = "flatbuffers_rs",
517 srcs = ["flatbuffers.rs"],
518 crate_name = "aos_flatbuffers",
Austin Schuhdfa127f2022-10-26 21:17:42 -0700519 target_compatible_with = select({
520 "//conditions:default": ["//tools/platforms/rust:has_support"],
521 "//tools:has_msan": ["@platforms//:incompatible"],
522 }),
Brian Silvermand1805b62022-07-20 20:47:05 -0700523 visibility = ["//visibility:public"],
524 deps = [
525 "@com_github_google_flatbuffers//rust",
526 ],
527)
528
529rust_test(
530 name = "flatbuffers_rs_test",
531 crate = ":flatbuffers_rs",
532 deps = [
533 ":json_to_flatbuffer_rust_fbs",
534 ],
535)
536
Austin Schuhcb108412019-10-13 16:09:54 -0700537cc_test(
538 name = "configuration_test",
539 srcs = [
540 "configuration_test.cc",
541 ],
542 data = [
Nathan Leong307c9692022-10-08 15:25:03 -0700543 "//aos/events:ping_fbs_reflection_out",
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700544 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700545 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700546 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700547 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800548 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700549 deps = [
550 ":configuration",
Nathan Leong307c9692022-10-08 15:25:03 -0700551 "//aos/events:ping_fbs",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800552 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700553 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700554 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700555 "//aos/testing:test_logging",
556 ],
557)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700558
559cc_binary(
560 name = "config_flattener",
561 srcs = [
562 "config_flattener.cc",
563 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800564 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700565 visibility = ["//visibility:public"],
566 deps = [
567 ":configuration",
568 ":init",
569 "//aos/util:file",
570 "@com_github_google_glog//:glog",
571 ],
572)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800573
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800574cc_library(
575 name = "aos_cli_utils",
576 srcs = [
577 "aos_cli_utils.cc",
578 ],
579 hdrs = [
580 "aos_cli_utils.h",
581 ],
582 target_compatible_with = ["@platforms//os:linux"],
583 visibility = ["//visibility:public"],
584 deps = [
585 ":configuration",
586 "//aos:init",
587 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700588 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800589 "@com_github_google_glog//:glog",
590 ],
591)
592
Tyler Chatow5e369a42019-11-23 11:57:31 -0800593cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800594 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800595 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800596 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800597 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800598 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800599 visibility = ["//visibility:public"],
600 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800601 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800602 ":configuration",
603 ":json_to_flatbuffer",
604 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800605 "@com_github_google_glog//:glog",
606 ],
607)
608
609cc_binary(
610 name = "aos_send",
611 srcs = [
612 "aos_send.cc",
613 ],
614 target_compatible_with = ["@platforms//os:linux"],
615 visibility = ["//visibility:public"],
616 deps = [
617 ":aos_cli_utils",
618 ":configuration",
619 ":init",
620 ":json_to_flatbuffer",
621 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800622 "@com_github_google_glog//:glog",
623 ],
624)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500625
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700626cc_binary(
627 name = "aos_graph_nodes",
628 srcs = [
629 "aos_graph_nodes.cc",
630 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800631 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700632 visibility = ["//visibility:public"],
633 deps = [
634 ":configuration",
635 ":json_to_flatbuffer",
636 "//aos:init",
637 "//aos/events:shm_event_loop",
638 "@com_github_google_glog//:glog",
639 ],
640)
641
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500642cc_library(
643 name = "ftrace",
644 srcs = [
645 "ftrace.cc",
646 ],
647 hdrs = [
648 "ftrace.h",
649 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800650 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500651 visibility = ["//visibility:public"],
652 deps = [
653 "@com_github_google_glog//:glog",
Austin Schuhc9de0132022-12-26 18:04:53 -0800654 "@com_google_absl//absl/strings",
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500655 ],
656)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700657
658cc_library(
659 name = "fast_string_builder",
660 srcs = [
661 "fast_string_builder.cc",
662 ],
663 hdrs = [
664 "fast_string_builder.h",
665 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800666 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700667 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700668 deps = [
669 "@com_github_google_glog//:glog",
670 "@com_google_absl//absl/strings",
671 "@com_google_absl//absl/strings:str_format",
672 ],
673)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700674
Austin Schuhcc6070c2020-10-10 20:25:56 -0700675cc_test(
676 name = "realtime_test",
677 srcs = [
678 "realtime_test.cc",
679 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800680 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700681 visibility = ["//visibility:public"],
682 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700683 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700684 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700685 "@com_github_gflags_gflags//:gflags",
686 "@com_github_google_glog//:glog",
687 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700688 ],
689)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800690
691cc_test(
692 name = "flatbuffers_test",
693 srcs = [
694 "flatbuffers_test.cc",
695 ],
696 deps = [
697 ":flatbuffers",
698 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800699 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800700 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700701 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800702 ],
703)
Austin Schuh0de30f32020-12-06 12:44:28 -0800704
705py_binary(
706 name = "flatbuffers_static",
707 srcs = ["flatbuffers_static.py"],
708 visibility = ["//visibility:public"],
709)
Austin Schuh4385b142021-03-14 21:31:13 -0700710
711cc_library(
712 name = "uuid",
713 srcs = ["uuid.cc"],
714 hdrs = ["uuid.h"],
715 target_compatible_with = ["@platforms//os:linux"],
716 visibility = ["//visibility:public"],
717 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700718 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700719 "@com_github_google_flatbuffers//:flatbuffers",
720 "@com_github_google_glog//:glog",
721 "@com_google_absl//absl/types:span",
722 ],
723)
724
725cc_test(
James Kuszmaul05ccb272023-07-13 10:58:14 -0700726 name = "uuid_collision_test",
James Kuszmaula791b762023-07-13 14:56:21 -0700727 timeout = "eternal",
James Kuszmaul05ccb272023-07-13 10:58:14 -0700728 srcs = ["uuid_collision_test.cc"],
James Kuszmaula791b762023-07-13 14:56:21 -0700729 shard_count = 2,
James Kuszmaul05ccb272023-07-13 10:58:14 -0700730 target_compatible_with = ["@platforms//os:linux"],
731 deps = [
732 ":uuid",
733 "//aos/testing:googletest",
734 ],
735)
736
737cc_test(
Austin Schuh4385b142021-03-14 21:31:13 -0700738 name = "uuid_test",
739 srcs = ["uuid_test.cc"],
740 target_compatible_with = ["@platforms//os:linux"],
741 deps = [
742 ":uuid",
743 "//aos/testing:googletest",
744 ],
745)
Austin Schuh30f74292021-08-13 17:25:26 -0700746
Brian Silverman10599932022-08-15 06:05:53 -0700747cc_library(
748 name = "uuid_for_rust",
749 hdrs = ["uuid_for_rust.h"],
750 deps = [
751 ":uuid",
752 ],
753)
754
755autocxx_library(
756 name = "uuid_rs",
757 srcs = ["uuid.rs"],
758 crate_name = "aos_uuid",
759 libs = [
760 ":uuid",
761 ":uuid_for_rust",
762 ],
763 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
764 rs_deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700765 "@crate_index//:uuid",
Brian Silverman10599932022-08-15 06:05:53 -0700766 ],
Austin Schuhdfa127f2022-10-26 21:17:42 -0700767 target_compatible_with = select({
768 "//conditions:default": ["//tools/platforms/rust:has_support"],
769 "//tools:has_msan": ["@platforms//:incompatible"],
770 }),
Brian Silverman10599932022-08-15 06:05:53 -0700771 visibility = ["//visibility:public"],
772)
773
Austin Schuh30f74292021-08-13 17:25:26 -0700774cc_binary(
775 name = "aos_graph_channels",
776 srcs = [
777 "aos_graph_channels.cc",
778 ],
779 target_compatible_with = ["@platforms//os:linux"],
780 deps = [
781 "//aos:configuration",
782 "//aos:init",
783 "//aos:json_to_flatbuffer",
784 "//aos/events:simulated_event_loop",
785 "//aos/events/logging:log_reader",
786 "//aos/time",
787 "@com_github_gflags_gflags//:gflags",
788 "@com_github_google_glog//:glog",
789 ],
790)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700791
792cc_library(
793 name = "for_rust",
794 hdrs = [
795 "for_rust.h",
796 ],
797 visibility = ["//visibility:public"],
798 deps = [
Adam Snaider770b97b2023-08-04 21:07:48 -0700799 "@crate_index//:cxx_cc",
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700800 ],
801)
Austin Schuhb0e439d2023-05-15 10:55:40 -0700802
803cc_library(
804 name = "sha256",
805 srcs = [
806 "sha256.cc",
807 ],
808 hdrs = ["sha256.h"],
809 target_compatible_with = ["@platforms//os:linux"],
810 visibility = ["//visibility:public"],
811 deps = [
James Kuszmaul56802ab2023-08-23 15:18:34 -0700812 "//aos/util:file",
Austin Schuhb0e439d2023-05-15 10:55:40 -0700813 "@boringssl//:crypto",
814 "@com_google_absl//absl/types:span",
815 ],
816)
James Kuszmaul56802ab2023-08-23 15:18:34 -0700817
818cc_test(
819 name = "sha256_test",
820 srcs = ["sha256_test.cc"],
821 deps = [
822 ":sha256",
823 "//aos/testing:googletest",
824 "//aos/testing:tmpdir",
825 ],
826)