blob: 8e223b72741428c1517bcd099d6066c7c98b916a [file] [log] [blame]
Brian Silvermand1805b62022-07-20 20:47:05 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library", "flatbuffer_rust_library", "flatbuffer_ts_library")
2load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
James Kuszmaule4aa01d2022-06-28 14:09:02 -07003load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
Brian Silverman7edd1ce2022-07-23 16:10:54 -07004load("//tools/build_rules:autocxx.bzl", "autocxx_library")
Austin Schuh972e47e2018-12-20 17:20:58 -08005
Austin Schuh00e302a2020-12-21 11:53:30 -08006exports_files(["aos_dump_autocomplete.sh"])
7
Brian Silverman258b9172015-09-19 14:32:57 -04008filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -07009 name = "prime_binaries",
10 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080011 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070012 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080013 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080014 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070015 ],
16 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080017)
Austin Schuhc80dd152016-02-29 01:47:44 -080018
19filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070020 name = "prime_start_binaries",
21 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080022 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070023 ],
24 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080025)
Brian Silverman6470f442018-08-05 12:08:16 -070026
Austin Schuhc80dd152016-02-29 01:47:44 -080027filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070028 name = "prime_binaries_stripped",
29 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080030 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070031 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080032 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070033 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070034 ],
35 visibility = ["//visibility:public"],
36)
37
38filegroup(
39 name = "prime_start_binaries_stripped",
40 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080041 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070042 ],
43 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080044)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070045
46cc_library(
John Park33858a32018-09-28 23:05:48 -070047 name = "math",
48 hdrs = [
49 "commonmath.h",
50 ],
John Park33858a32018-09-28 23:05:48 -070051 visibility = ["//visibility:public"],
52)
53
Brian Silverman6470f442018-08-05 12:08:16 -070054py_library(
55 name = "python_init",
56 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080057 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070058 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070059)
John Park33858a32018-09-28 23:05:48 -070060
61cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080062 name = "macros",
63 hdrs = [
John Park33858a32018-09-28 23:05:48 -070064 "macros.h",
John Park33858a32018-09-28 23:05:48 -070065 ],
66 visibility = ["//visibility:public"],
67)
68
69cc_library(
70 name = "gtest_prod",
71 hdrs = [
72 "gtest_prod.h",
73 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080074 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070075 visibility = ["//visibility:public"],
76)
77
78cc_library(
John Park33858a32018-09-28 23:05:48 -070079 name = "unique_malloc_ptr",
80 hdrs = [
81 "unique_malloc_ptr.h",
82 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080083 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070084 visibility = ["//visibility:public"],
85)
86
87cc_library(
88 name = "condition",
89 srcs = [
90 "condition.cc",
91 ],
92 hdrs = [
93 "condition.h",
94 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080095 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070096 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -080097 deps = [
98 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -080099 "//aos/mutex",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700100 "@com_github_google_glog//:glog",
Austin Schuh972e47e2018-12-20 17:20:58 -0800101 ],
John Park33858a32018-09-28 23:05:48 -0700102)
103
104cc_test(
105 name = "condition_test",
106 srcs = [
107 "condition_test.cc",
108 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800109 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700110 deps = [
111 ":condition",
112 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700113 "//aos/ipc_lib:aos_sync",
114 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800115 "//aos/logging",
116 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700117 "//aos/testing:googletest",
118 "//aos/testing:prevent_exit",
119 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800120 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700121 ],
122)
123
124cc_library(
125 name = "die",
126 srcs = [
127 "die.cc",
128 ],
129 hdrs = [
130 "die.h",
131 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800132 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800133 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700134 deps = [
135 "//aos:macros",
136 "//aos/libc:aos_strerror",
137 ],
John Park33858a32018-09-28 23:05:48 -0700138)
139
John Park33858a32018-09-28 23:05:48 -0700140cc_test(
141 name = "die_test",
142 srcs = [
143 "die_test.cc",
144 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800145 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700146 deps = [
147 ":die",
148 "//aos/testing:googletest",
149 ],
150)
151
John Park398c74a2018-10-20 21:17:39 -0700152cc_binary(
153 name = "dump_rtprio",
154 srcs = [
155 "dump_rtprio.cc",
156 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800157 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700158 deps = [
Austin Schuh972e47e2018-12-20 17:20:58 -0800159 "//aos/time",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700160 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700161 ],
162)
163
164cc_library(
John Park398c74a2018-10-20 21:17:39 -0700165 name = "init",
166 srcs = [
167 "init.cc",
168 ],
169 hdrs = [
170 "init.h",
171 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800172 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800173 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700174 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700175 ":realtime",
John Park398c74a2018-10-20 21:17:39 -0700176 "//aos:die",
Austin Schuh972e47e2018-12-20 17:20:58 -0800177 "//aos/logging:implementations",
John Park398c74a2018-10-20 21:17:39 -0700178 ],
John Park398c74a2018-10-20 21:17:39 -0700179)
180
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700181autocxx_library(
182 name = "init_rs",
183 srcs = ["init.rs"],
184 crate_name = "aos_init",
185 libs = [
186 ":init",
187 ],
188 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
189 target_compatible_with = ["//tools/platforms/rust:has_support"],
190 visibility = ["//visibility:public"],
191)
192
Alex Perrycb7da4b2019-08-28 19:35:56 -0700193cc_library(
194 name = "realtime",
195 srcs = [
196 "realtime.cc",
197 ],
198 hdrs = [
199 "realtime.h",
200 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800201 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700202 visibility = ["//visibility:public"],
203 deps = [
Austin Schuhcc6070c2020-10-10 20:25:56 -0700204 ":thread_local",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700205 "@com_github_google_glog//:glog",
206 ],
207)
208
Austin Schuhcb108412019-10-13 16:09:54 -0700209flatbuffer_cc_library(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700210 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700211 srcs = ["configuration.fbs"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700212 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800213 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700214 visibility = ["//visibility:public"],
Austin Schuhcb108412019-10-13 16:09:54 -0700215)
216
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700217cc_static_flatbuffer(
218 name = "configuration_schema",
219 function = "aos::ConfigurationSchema",
220 target = ":configuration_fbs_reflection_out",
221 visibility = ["//visibility:public"],
222)
223
Alex Perryd5e13572020-02-22 15:15:08 -0800224flatbuffer_ts_library(
225 name = "configuration_ts_fbs",
226 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800227 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800228 visibility = ["//visibility:public"],
229)
230
Brian Silverman28760272020-02-02 13:21:51 -0800231flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800232 name = "configuration_fbs_python",
233 srcs = ["configuration.fbs"],
234 namespace = "aos",
235 tables = [
236 "Configuration",
237 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800238 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800239 "Map",
240 "Node",
241 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800242 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800243 visibility = ["//visibility:public"],
244)
245
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700246flatbuffer_rust_library(
247 name = "configuration_rust_fbs",
248 srcs = ["configuration.fbs"],
249 crate_name = "aos_configuration_fbs",
250 target_compatible_with = ["//tools/platforms/rust:has_support"],
251 visibility = ["//visibility:public"],
252)
253
John Park398c74a2018-10-20 21:17:39 -0700254cc_library(
255 name = "configuration",
256 srcs = [
257 "configuration.cc",
258 ],
259 hdrs = [
260 "configuration.h",
261 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800262 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800263 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700264 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700265 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700266 ":flatbuffer_merge",
267 ":flatbuffers",
268 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700269 "//aos:unique_malloc_ptr",
Austin Schuh217a9782019-12-21 23:02:50 -0800270 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700271 "//aos/util:file",
272 "@com_github_google_glog//:glog",
273 "@com_google_absl//absl/container:btree",
274 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700275 ],
John Park398c74a2018-10-20 21:17:39 -0700276)
277
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700278cc_library(
279 name = "configuration_for_rust",
280 srcs = [
281 "configuration_for_rust.cc",
282 ],
283 hdrs = [
284 "configuration_for_rust.h",
285 ],
286 deps = [
287 ":configuration",
288 ":for_rust",
289 "//third_party/cargo:cxx_cc",
290 ],
291)
292
293autocxx_library(
294 name = "configuration_rs",
295 srcs = ["configuration.rs"],
296 crate_name = "aos_configuration",
297 libs = [
298 ":configuration",
299 ":configuration_for_rust",
300 ":configuration_fbs",
301 ],
302 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
303 target_compatible_with = ["//tools/platforms/rust:has_support"],
304 visibility = ["//visibility:public"],
305 deps = [
306 ":configuration_rust_fbs",
307 ":flatbuffers_rs",
308 "//third_party/cargo:thiserror",
309 ],
310)
311
312rust_test(
313 name = "configuration_rs_test",
314 crate = ":configuration_rs",
315 data = [
316 "//aos/testdata:test_configs",
317 ],
318 # TODO: Make Rust play happy with pic vs nopic. Details at:
319 # https://github.com/bazelbuild/rules_rust/issues/118
320 rustc_flags = ["-Crelocation-model=static"],
321)
322
James Kuszmaulabb77132020-08-01 19:56:16 -0700323flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800324 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700325 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800326 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700327 visibility = ["//aos:__subpackages__"],
328)
329
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700330flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800331 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700332 srcs = ["json_to_flatbuffer.fbs"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800333 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800334 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700335 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700336)
337
Brian Silvermand1805b62022-07-20 20:47:05 -0700338flatbuffer_rust_library(
339 name = "json_to_flatbuffer_rust_fbs",
340 srcs = ["json_to_flatbuffer.fbs"],
341 crate_name = "aos_json_to_flatbuffer_fbs",
342 target_compatible_with = ["//tools/platforms/rust:has_support"],
343 visibility = ["//aos:__subpackages__"],
344)
345
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700346cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700347 name = "flatbuffer_utils",
348 srcs = ["flatbuffer_utils.cc"],
349 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800350 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700351 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700352 deps = [
353 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800354 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700355 ],
356)
357
358cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700359 name = "json_tokenizer",
360 srcs = ["json_tokenizer.cc"],
361 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800362 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700363 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700364 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700365 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700366 "@com_google_absl//absl/strings",
367 ],
368)
369
370cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700371 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800372 srcs = [
373 "flatbuffer_introspection.cc",
374 "json_to_flatbuffer.cc",
375 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700376 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800377 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700378 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700379 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700380 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700381 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700382 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700383 ":json_tokenizer",
Austin Schuhbba10282021-03-20 22:03:28 -0700384 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700385 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700386 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700387 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700388 ],
389)
390
391cc_test(
392 name = "json_to_flatbuffer_test",
393 srcs = [
394 "json_to_flatbuffer_test.cc",
395 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800396 data = [
397 ":json_to_flatbuffer_fbs_reflection_out",
398 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800399 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700400 deps = [
401 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800402 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700403 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700404 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700405 ],
406)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700407
Tyler Chatow5e369a42019-11-23 11:57:31 -0800408cc_test(
409 name = "flatbuffer_introspection_test",
410 srcs = [
411 "flatbuffer_introspection_test.cc",
412 ],
413 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800414 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800415 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800416 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800417 deps = [
418 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800419 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800420 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700421 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800422 "//aos/util:file",
423 "@com_github_google_flatbuffers//:flatbuffers",
424 ],
425)
426
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700427cc_library(
428 name = "flatbuffer_merge",
429 srcs = ["flatbuffer_merge.cc"],
430 hdrs = ["flatbuffer_merge.h"],
431 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800432 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700433 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700434 deps = [
435 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700436 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700437 "@com_github_google_flatbuffers//:flatbuffers",
438 ],
439)
440
441cc_test(
442 name = "flatbuffer_merge_test",
443 srcs = [
444 "flatbuffer_merge_test.cc",
445 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800446 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700447 deps = [
448 ":flatbuffer_merge",
449 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800450 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700451 "//aos/testing:googletest",
452 ],
453)
Austin Schuhe93d8642019-10-13 15:27:07 -0700454
455cc_library(
456 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700457 srcs = [
458 "flatbuffers.cc",
459 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700460 hdrs = [
461 "flatbuffers.h",
462 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800463 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700464 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700465 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800466 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700467 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700468 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700469 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700470 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700471 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800472 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700473 ],
474)
Austin Schuhcb108412019-10-13 16:09:54 -0700475
Brian Silvermand1805b62022-07-20 20:47:05 -0700476rust_library(
477 name = "flatbuffers_rs",
478 srcs = ["flatbuffers.rs"],
479 crate_name = "aos_flatbuffers",
480 target_compatible_with = ["//tools/platforms/rust:has_support"],
481 visibility = ["//visibility:public"],
482 deps = [
483 "@com_github_google_flatbuffers//rust",
484 ],
485)
486
487rust_test(
488 name = "flatbuffers_rs_test",
489 crate = ":flatbuffers_rs",
490 deps = [
491 ":json_to_flatbuffer_rust_fbs",
492 ],
493)
494
Austin Schuhcb108412019-10-13 16:09:54 -0700495cc_test(
496 name = "configuration_test",
497 srcs = [
498 "configuration_test.cc",
499 ],
500 data = [
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700501 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700502 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700503 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700504 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800505 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700506 deps = [
507 ":configuration",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800508 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700509 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700510 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700511 "//aos/testing:test_logging",
512 ],
513)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700514
515cc_binary(
516 name = "config_flattener",
517 srcs = [
518 "config_flattener.cc",
519 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800520 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700521 visibility = ["//visibility:public"],
522 deps = [
523 ":configuration",
524 ":init",
525 "//aos/util:file",
526 "@com_github_google_glog//:glog",
527 ],
528)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800529
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800530cc_library(
531 name = "aos_cli_utils",
532 srcs = [
533 "aos_cli_utils.cc",
534 ],
535 hdrs = [
536 "aos_cli_utils.h",
537 ],
538 target_compatible_with = ["@platforms//os:linux"],
539 visibility = ["//visibility:public"],
540 deps = [
541 ":configuration",
542 "//aos:init",
543 "//aos/events:shm_event_loop",
544 "@com_github_google_glog//:glog",
545 ],
546)
547
Tyler Chatow5e369a42019-11-23 11:57:31 -0800548cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800549 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800550 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800551 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800552 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800553 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800554 visibility = ["//visibility:public"],
555 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800556 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800557 ":configuration",
558 ":json_to_flatbuffer",
559 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800560 "@com_github_google_glog//:glog",
561 ],
562)
563
564cc_binary(
565 name = "aos_send",
566 srcs = [
567 "aos_send.cc",
568 ],
569 target_compatible_with = ["@platforms//os:linux"],
570 visibility = ["//visibility:public"],
571 deps = [
572 ":aos_cli_utils",
573 ":configuration",
574 ":init",
575 ":json_to_flatbuffer",
576 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800577 "@com_github_google_glog//:glog",
578 ],
579)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500580
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700581cc_binary(
582 name = "aos_graph_nodes",
583 srcs = [
584 "aos_graph_nodes.cc",
585 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800586 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700587 visibility = ["//visibility:public"],
588 deps = [
589 ":configuration",
590 ":json_to_flatbuffer",
591 "//aos:init",
592 "//aos/events:shm_event_loop",
593 "@com_github_google_glog//:glog",
594 ],
595)
596
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500597cc_library(
598 name = "ftrace",
599 srcs = [
600 "ftrace.cc",
601 ],
602 hdrs = [
603 "ftrace.h",
604 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800605 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500606 visibility = ["//visibility:public"],
607 deps = [
608 "@com_github_google_glog//:glog",
609 ],
610)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700611
612cc_library(
613 name = "fast_string_builder",
614 srcs = [
615 "fast_string_builder.cc",
616 ],
617 hdrs = [
618 "fast_string_builder.h",
619 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800620 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700621 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700622 deps = [
623 "@com_github_google_glog//:glog",
624 "@com_google_absl//absl/strings",
625 "@com_google_absl//absl/strings:str_format",
626 ],
627)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700628
629cc_library(
630 name = "thread_local",
631 hdrs = [
632 "thread_local.h",
633 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800634 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb47f5552020-10-01 15:08:14 -0700635 visibility = ["//visibility:public"],
636)
Austin Schuhcc6070c2020-10-10 20:25:56 -0700637
638cc_test(
639 name = "realtime_test",
640 srcs = [
641 "realtime_test.cc",
642 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800643 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700644 visibility = ["//visibility:public"],
645 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700646 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700647 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700648 "@com_github_gflags_gflags//:gflags",
649 "@com_github_google_glog//:glog",
650 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700651 ],
652)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800653
654cc_test(
655 name = "flatbuffers_test",
656 srcs = [
657 "flatbuffers_test.cc",
658 ],
659 deps = [
660 ":flatbuffers",
661 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800662 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800663 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700664 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800665 ],
666)
Austin Schuh0de30f32020-12-06 12:44:28 -0800667
668py_binary(
669 name = "flatbuffers_static",
670 srcs = ["flatbuffers_static.py"],
671 visibility = ["//visibility:public"],
672)
Austin Schuh4385b142021-03-14 21:31:13 -0700673
674cc_library(
675 name = "uuid",
676 srcs = ["uuid.cc"],
677 hdrs = ["uuid.h"],
678 target_compatible_with = ["@platforms//os:linux"],
679 visibility = ["//visibility:public"],
680 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700681 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700682 "@com_github_google_flatbuffers//:flatbuffers",
683 "@com_github_google_glog//:glog",
684 "@com_google_absl//absl/types:span",
685 ],
686)
687
688cc_test(
689 name = "uuid_test",
690 srcs = ["uuid_test.cc"],
691 target_compatible_with = ["@platforms//os:linux"],
692 deps = [
693 ":uuid",
694 "//aos/testing:googletest",
695 ],
696)
Austin Schuh30f74292021-08-13 17:25:26 -0700697
Brian Silverman10599932022-08-15 06:05:53 -0700698cc_library(
699 name = "uuid_for_rust",
700 hdrs = ["uuid_for_rust.h"],
701 deps = [
702 ":uuid",
703 ],
704)
705
706autocxx_library(
707 name = "uuid_rs",
708 srcs = ["uuid.rs"],
709 crate_name = "aos_uuid",
710 libs = [
711 ":uuid",
712 ":uuid_for_rust",
713 ],
714 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
715 rs_deps = [
716 "//third_party/cargo:uuid",
717 ],
718 target_compatible_with = ["//tools/platforms/rust:has_support"],
719 visibility = ["//visibility:public"],
720)
721
Austin Schuh30f74292021-08-13 17:25:26 -0700722cc_binary(
723 name = "aos_graph_channels",
724 srcs = [
725 "aos_graph_channels.cc",
726 ],
727 target_compatible_with = ["@platforms//os:linux"],
728 deps = [
729 "//aos:configuration",
730 "//aos:init",
731 "//aos:json_to_flatbuffer",
732 "//aos/events:simulated_event_loop",
733 "//aos/events/logging:log_reader",
734 "//aos/time",
735 "@com_github_gflags_gflags//:gflags",
736 "@com_github_google_glog//:glog",
737 ],
738)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700739
740cc_library(
741 name = "for_rust",
742 hdrs = [
743 "for_rust.h",
744 ],
745 visibility = ["//visibility:public"],
746 deps = [
747 "//third_party/cargo:cxx_cc",
748 ],
749)