blob: d78b303e677b39d3c2d44c816fd820c2bd01c874 [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 Schuh972e47e2018-12-20 17:20:58 -0800160 "//aos/time",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700161 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700162 ],
163)
164
165cc_library(
John Park398c74a2018-10-20 21:17:39 -0700166 name = "init",
167 srcs = [
168 "init.cc",
169 ],
170 hdrs = [
171 "init.h",
172 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800173 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800174 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700175 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700176 ":realtime",
John Park398c74a2018-10-20 21:17:39 -0700177 "//aos:die",
Austin Schuh972e47e2018-12-20 17:20:58 -0800178 "//aos/logging:implementations",
John Park398c74a2018-10-20 21:17:39 -0700179 ],
John Park398c74a2018-10-20 21:17:39 -0700180)
181
Brian Silvermane4c79ce2022-08-15 05:57:28 -0700182autocxx_library(
183 name = "init_rs",
184 srcs = ["init.rs"],
185 crate_name = "aos_init",
186 libs = [
187 ":init",
188 ],
189 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
190 target_compatible_with = ["//tools/platforms/rust:has_support"],
191 visibility = ["//visibility:public"],
192)
193
Alex Perrycb7da4b2019-08-28 19:35:56 -0700194cc_library(
195 name = "realtime",
196 srcs = [
197 "realtime.cc",
198 ],
199 hdrs = [
200 "realtime.h",
201 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800202 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700203 visibility = ["//visibility:public"],
204 deps = [
Austin Schuhcc6070c2020-10-10 20:25:56 -0700205 ":thread_local",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700206 "@com_github_google_glog//:glog",
207 ],
208)
209
Austin Schuhcb108412019-10-13 16:09:54 -0700210flatbuffer_cc_library(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700211 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700212 srcs = ["configuration.fbs"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700213 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800214 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700215 visibility = ["//visibility:public"],
Austin Schuhcb108412019-10-13 16:09:54 -0700216)
217
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700218cc_static_flatbuffer(
219 name = "configuration_schema",
220 function = "aos::ConfigurationSchema",
221 target = ":configuration_fbs_reflection_out",
222 visibility = ["//visibility:public"],
223)
224
Alex Perryd5e13572020-02-22 15:15:08 -0800225flatbuffer_ts_library(
226 name = "configuration_ts_fbs",
227 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800228 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800229 visibility = ["//visibility:public"],
230)
231
Brian Silverman28760272020-02-02 13:21:51 -0800232flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800233 name = "configuration_fbs_python",
234 srcs = ["configuration.fbs"],
235 namespace = "aos",
236 tables = [
237 "Configuration",
238 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800239 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800240 "Map",
241 "Node",
242 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800243 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800244 visibility = ["//visibility:public"],
245)
246
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700247flatbuffer_rust_library(
248 name = "configuration_rust_fbs",
249 srcs = ["configuration.fbs"],
250 crate_name = "aos_configuration_fbs",
251 target_compatible_with = ["//tools/platforms/rust:has_support"],
252 visibility = ["//visibility:public"],
253)
254
John Park398c74a2018-10-20 21:17:39 -0700255cc_library(
256 name = "configuration",
257 srcs = [
258 "configuration.cc",
259 ],
260 hdrs = [
261 "configuration.h",
262 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800263 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800264 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700265 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700266 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700267 ":flatbuffer_merge",
268 ":flatbuffers",
269 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700270 "//aos:unique_malloc_ptr",
Austin Schuh217a9782019-12-21 23:02:50 -0800271 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700272 "//aos/util:file",
273 "@com_github_google_glog//:glog",
274 "@com_google_absl//absl/container:btree",
275 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700276 ],
John Park398c74a2018-10-20 21:17:39 -0700277)
278
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700279cc_library(
280 name = "configuration_for_rust",
281 srcs = [
282 "configuration_for_rust.cc",
283 ],
284 hdrs = [
285 "configuration_for_rust.h",
286 ],
287 deps = [
288 ":configuration",
289 ":for_rust",
290 "//third_party/cargo:cxx_cc",
291 ],
292)
293
294autocxx_library(
295 name = "configuration_rs",
296 srcs = ["configuration.rs"],
297 crate_name = "aos_configuration",
298 libs = [
299 ":configuration",
300 ":configuration_for_rust",
301 ":configuration_fbs",
302 ],
303 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
304 target_compatible_with = ["//tools/platforms/rust:has_support"],
305 visibility = ["//visibility:public"],
306 deps = [
307 ":configuration_rust_fbs",
308 ":flatbuffers_rs",
309 "//third_party/cargo:thiserror",
310 ],
311)
312
313rust_test(
314 name = "configuration_rs_test",
315 crate = ":configuration_rs",
316 data = [
317 "//aos/testdata:test_configs",
318 ],
319 # TODO: Make Rust play happy with pic vs nopic. Details at:
320 # https://github.com/bazelbuild/rules_rust/issues/118
321 rustc_flags = ["-Crelocation-model=static"],
322)
323
James Kuszmaulabb77132020-08-01 19:56:16 -0700324flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800325 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700326 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800327 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700328 visibility = ["//aos:__subpackages__"],
329)
330
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700331flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800332 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700333 srcs = ["json_to_flatbuffer.fbs"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800334 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800335 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700336 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700337)
338
Brian Silvermand1805b62022-07-20 20:47:05 -0700339flatbuffer_rust_library(
340 name = "json_to_flatbuffer_rust_fbs",
341 srcs = ["json_to_flatbuffer.fbs"],
342 crate_name = "aos_json_to_flatbuffer_fbs",
343 target_compatible_with = ["//tools/platforms/rust:has_support"],
344 visibility = ["//aos:__subpackages__"],
345)
346
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700347cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700348 name = "flatbuffer_utils",
349 srcs = ["flatbuffer_utils.cc"],
350 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800351 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700352 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700353 deps = [
354 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800355 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700356 ],
357)
358
359cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700360 name = "json_tokenizer",
361 srcs = ["json_tokenizer.cc"],
362 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800363 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700364 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700365 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700366 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700367 "@com_google_absl//absl/strings",
368 ],
369)
370
371cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700372 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800373 srcs = [
374 "flatbuffer_introspection.cc",
375 "json_to_flatbuffer.cc",
376 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700377 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800378 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700379 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700380 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700381 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700382 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700383 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700384 ":json_tokenizer",
Austin Schuhbba10282021-03-20 22:03:28 -0700385 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700386 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700387 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700388 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700389 ],
390)
391
392cc_test(
393 name = "json_to_flatbuffer_test",
394 srcs = [
395 "json_to_flatbuffer_test.cc",
396 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800397 data = [
398 ":json_to_flatbuffer_fbs_reflection_out",
399 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800400 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700401 deps = [
402 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800403 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700404 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700405 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700406 ],
407)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700408
Tyler Chatow5e369a42019-11-23 11:57:31 -0800409cc_test(
410 name = "flatbuffer_introspection_test",
411 srcs = [
412 "flatbuffer_introspection_test.cc",
413 ],
414 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800415 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800416 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800417 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800418 deps = [
419 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800420 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800421 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700422 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800423 "//aos/util:file",
424 "@com_github_google_flatbuffers//:flatbuffers",
425 ],
426)
427
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700428cc_library(
429 name = "flatbuffer_merge",
430 srcs = ["flatbuffer_merge.cc"],
431 hdrs = ["flatbuffer_merge.h"],
432 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800433 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700434 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700435 deps = [
436 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700437 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700438 "@com_github_google_flatbuffers//:flatbuffers",
439 ],
440)
441
442cc_test(
443 name = "flatbuffer_merge_test",
444 srcs = [
445 "flatbuffer_merge_test.cc",
446 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800447 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700448 deps = [
449 ":flatbuffer_merge",
450 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800451 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700452 "//aos/testing:googletest",
453 ],
454)
Austin Schuhe93d8642019-10-13 15:27:07 -0700455
456cc_library(
457 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700458 srcs = [
459 "flatbuffers.cc",
460 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700461 hdrs = [
462 "flatbuffers.h",
463 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800464 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700465 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700466 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800467 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700468 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700469 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700470 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700471 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700472 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800473 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700474 ],
475)
Austin Schuhcb108412019-10-13 16:09:54 -0700476
Brian Silvermand1805b62022-07-20 20:47:05 -0700477rust_library(
478 name = "flatbuffers_rs",
479 srcs = ["flatbuffers.rs"],
480 crate_name = "aos_flatbuffers",
481 target_compatible_with = ["//tools/platforms/rust:has_support"],
482 visibility = ["//visibility:public"],
483 deps = [
484 "@com_github_google_flatbuffers//rust",
485 ],
486)
487
488rust_test(
489 name = "flatbuffers_rs_test",
490 crate = ":flatbuffers_rs",
491 deps = [
492 ":json_to_flatbuffer_rust_fbs",
493 ],
494)
495
Austin Schuhcb108412019-10-13 16:09:54 -0700496cc_test(
497 name = "configuration_test",
498 srcs = [
499 "configuration_test.cc",
500 ],
501 data = [
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700502 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700503 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700504 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700505 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800506 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700507 deps = [
508 ":configuration",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800509 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700510 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700511 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700512 "//aos/testing:test_logging",
513 ],
514)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700515
516cc_binary(
517 name = "config_flattener",
518 srcs = [
519 "config_flattener.cc",
520 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800521 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700522 visibility = ["//visibility:public"],
523 deps = [
524 ":configuration",
525 ":init",
526 "//aos/util:file",
527 "@com_github_google_glog//:glog",
528 ],
529)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800530
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800531cc_library(
532 name = "aos_cli_utils",
533 srcs = [
534 "aos_cli_utils.cc",
535 ],
536 hdrs = [
537 "aos_cli_utils.h",
538 ],
539 target_compatible_with = ["@platforms//os:linux"],
540 visibility = ["//visibility:public"],
541 deps = [
542 ":configuration",
543 "//aos:init",
544 "//aos/events:shm_event_loop",
Austin Schuh893d7f42022-09-16 15:01:35 -0700545 "//aos/events:simulated_event_loop",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800546 "@com_github_google_glog//:glog",
547 ],
548)
549
Tyler Chatow5e369a42019-11-23 11:57:31 -0800550cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800551 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800552 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800553 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800554 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800555 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800556 visibility = ["//visibility:public"],
557 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800558 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800559 ":configuration",
560 ":json_to_flatbuffer",
561 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800562 "@com_github_google_glog//:glog",
563 ],
564)
565
566cc_binary(
567 name = "aos_send",
568 srcs = [
569 "aos_send.cc",
570 ],
571 target_compatible_with = ["@platforms//os:linux"],
572 visibility = ["//visibility:public"],
573 deps = [
574 ":aos_cli_utils",
575 ":configuration",
576 ":init",
577 ":json_to_flatbuffer",
578 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800579 "@com_github_google_glog//:glog",
580 ],
581)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500582
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700583cc_binary(
584 name = "aos_graph_nodes",
585 srcs = [
586 "aos_graph_nodes.cc",
587 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800588 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700589 visibility = ["//visibility:public"],
590 deps = [
591 ":configuration",
592 ":json_to_flatbuffer",
593 "//aos:init",
594 "//aos/events:shm_event_loop",
595 "@com_github_google_glog//:glog",
596 ],
597)
598
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500599cc_library(
600 name = "ftrace",
601 srcs = [
602 "ftrace.cc",
603 ],
604 hdrs = [
605 "ftrace.h",
606 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800607 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500608 visibility = ["//visibility:public"],
609 deps = [
610 "@com_github_google_glog//:glog",
611 ],
612)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700613
614cc_library(
615 name = "fast_string_builder",
616 srcs = [
617 "fast_string_builder.cc",
618 ],
619 hdrs = [
620 "fast_string_builder.h",
621 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800622 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700623 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700624 deps = [
625 "@com_github_google_glog//:glog",
626 "@com_google_absl//absl/strings",
627 "@com_google_absl//absl/strings:str_format",
628 ],
629)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700630
631cc_library(
632 name = "thread_local",
633 hdrs = [
634 "thread_local.h",
635 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800636 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb47f5552020-10-01 15:08:14 -0700637 visibility = ["//visibility:public"],
638)
Austin Schuhcc6070c2020-10-10 20:25:56 -0700639
640cc_test(
641 name = "realtime_test",
642 srcs = [
643 "realtime_test.cc",
644 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800645 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700646 visibility = ["//visibility:public"],
647 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700648 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700649 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700650 "@com_github_gflags_gflags//:gflags",
651 "@com_github_google_glog//:glog",
652 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700653 ],
654)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800655
656cc_test(
657 name = "flatbuffers_test",
658 srcs = [
659 "flatbuffers_test.cc",
660 ],
661 deps = [
662 ":flatbuffers",
663 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800664 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800665 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700666 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800667 ],
668)
Austin Schuh0de30f32020-12-06 12:44:28 -0800669
670py_binary(
671 name = "flatbuffers_static",
672 srcs = ["flatbuffers_static.py"],
673 visibility = ["//visibility:public"],
674)
Austin Schuh4385b142021-03-14 21:31:13 -0700675
676cc_library(
677 name = "uuid",
678 srcs = ["uuid.cc"],
679 hdrs = ["uuid.h"],
680 target_compatible_with = ["@platforms//os:linux"],
681 visibility = ["//visibility:public"],
682 deps = [
Austin Schuh81d0fe42022-08-17 16:29:23 -0700683 ":thread_local",
Austin Schuh8902fa52021-03-14 22:39:24 -0700684 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700685 "@com_github_google_flatbuffers//:flatbuffers",
686 "@com_github_google_glog//:glog",
687 "@com_google_absl//absl/types:span",
688 ],
689)
690
691cc_test(
692 name = "uuid_test",
693 srcs = ["uuid_test.cc"],
694 target_compatible_with = ["@platforms//os:linux"],
695 deps = [
696 ":uuid",
697 "//aos/testing:googletest",
698 ],
699)
Austin Schuh30f74292021-08-13 17:25:26 -0700700
Brian Silverman10599932022-08-15 06:05:53 -0700701cc_library(
702 name = "uuid_for_rust",
703 hdrs = ["uuid_for_rust.h"],
704 deps = [
705 ":uuid",
706 ],
707)
708
709autocxx_library(
710 name = "uuid_rs",
711 srcs = ["uuid.rs"],
712 crate_name = "aos_uuid",
713 libs = [
714 ":uuid",
715 ":uuid_for_rust",
716 ],
717 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
718 rs_deps = [
719 "//third_party/cargo:uuid",
720 ],
721 target_compatible_with = ["//tools/platforms/rust:has_support"],
722 visibility = ["//visibility:public"],
723)
724
Austin Schuh30f74292021-08-13 17:25:26 -0700725cc_binary(
726 name = "aos_graph_channels",
727 srcs = [
728 "aos_graph_channels.cc",
729 ],
730 target_compatible_with = ["@platforms//os:linux"],
731 deps = [
732 "//aos:configuration",
733 "//aos:init",
734 "//aos:json_to_flatbuffer",
735 "//aos/events:simulated_event_loop",
736 "//aos/events/logging:log_reader",
737 "//aos/time",
738 "@com_github_gflags_gflags//:gflags",
739 "@com_github_google_glog//:glog",
740 ],
741)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700742
743cc_library(
744 name = "for_rust",
745 hdrs = [
746 "for_rust.h",
747 ],
748 visibility = ["//visibility:public"],
749 deps = [
750 "//third_party/cargo:cxx_cc",
751 ],
752)