blob: 1380f7de51b06d01cddc25095196616cde5c0646 [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")
Brian Silverman7edd1ce2022-07-23 16:10:54 -07003load("//tools/build_rules:autocxx.bzl", "autocxx_library")
Austin Schuh972e47e2018-12-20 17:20:58 -08004
Austin Schuh00e302a2020-12-21 11:53:30 -08005exports_files(["aos_dump_autocomplete.sh"])
6
Brian Silverman258b9172015-09-19 14:32:57 -04007filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -07008 name = "prime_binaries",
9 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080010 "//aos:aos_dump",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070011 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080012 "//aos:aos_send",
Austin Schuh91d8d062020-11-02 17:11:13 -080013 "//aos/starter",
Brian Silverman6470f442018-08-05 12:08:16 -070014 ],
15 visibility = ["//visibility:public"],
Austin Schuh1eceeb92015-11-08 21:16:06 -080016)
Austin Schuhc80dd152016-02-29 01:47:44 -080017
18filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070019 name = "prime_start_binaries",
20 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080021 "//aos/events/logging:logger_main",
Brian Silverman6470f442018-08-05 12:08:16 -070022 ],
23 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080024)
Brian Silverman6470f442018-08-05 12:08:16 -070025
Austin Schuhc80dd152016-02-29 01:47:44 -080026filegroup(
Brian Silverman6470f442018-08-05 12:08:16 -070027 name = "prime_binaries_stripped",
28 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -080029 "//aos:aos_dump.stripped",
Tyler Chatowe6f5bef2020-10-31 14:22:04 -070030 "//aos:aos_dump_autocomplete.sh",
Brian Silvermanea2c95f2021-02-10 18:10:26 -080031 "//aos:aos_send.stripped",
Austin Schuh44e0b142021-10-16 15:51:10 -070032 "//aos/starter:starter_stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070033 ],
34 visibility = ["//visibility:public"],
35)
36
37filegroup(
38 name = "prime_start_binaries_stripped",
39 srcs = [
James Kuszmaul38735e82019-12-07 16:42:06 -080040 "//aos/events/logging:logger_main.stripped",
Brian Silverman6470f442018-08-05 12:08:16 -070041 ],
42 visibility = ["//visibility:public"],
Austin Schuhc80dd152016-02-29 01:47:44 -080043)
Sabina Davis2ed5ea22017-09-26 22:27:42 -070044
45cc_library(
John Park33858a32018-09-28 23:05:48 -070046 name = "math",
47 hdrs = [
48 "commonmath.h",
49 ],
John Park33858a32018-09-28 23:05:48 -070050 visibility = ["//visibility:public"],
51)
52
Brian Silverman6470f442018-08-05 12:08:16 -070053py_library(
54 name = "python_init",
55 srcs = ["__init__.py"],
Philipp Schraderdada1072020-11-24 11:34:46 -080056 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman6470f442018-08-05 12:08:16 -070057 visibility = ["//visibility:public"],
Sabina Davis2ed5ea22017-09-26 22:27:42 -070058)
John Park33858a32018-09-28 23:05:48 -070059
60cc_library(
Austin Schuh972e47e2018-12-20 17:20:58 -080061 name = "macros",
62 hdrs = [
John Park33858a32018-09-28 23:05:48 -070063 "macros.h",
John Park33858a32018-09-28 23:05:48 -070064 ],
65 visibility = ["//visibility:public"],
66)
67
68cc_library(
69 name = "gtest_prod",
70 hdrs = [
71 "gtest_prod.h",
72 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080073 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070074 visibility = ["//visibility:public"],
75)
76
77cc_library(
John Park33858a32018-09-28 23:05:48 -070078 name = "unique_malloc_ptr",
79 hdrs = [
80 "unique_malloc_ptr.h",
81 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080082 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070083 visibility = ["//visibility:public"],
84)
85
86cc_library(
87 name = "condition",
88 srcs = [
89 "condition.cc",
90 ],
91 hdrs = [
92 "condition.h",
93 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080094 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -070095 visibility = ["//visibility:public"],
Austin Schuh972e47e2018-12-20 17:20:58 -080096 deps = [
97 "//aos/ipc_lib:aos_sync",
Austin Schuh972e47e2018-12-20 17:20:58 -080098 "//aos/mutex",
Alex Perrycb7da4b2019-08-28 19:35:56 -070099 "@com_github_google_glog//:glog",
Austin Schuh972e47e2018-12-20 17:20:58 -0800100 ],
John Park33858a32018-09-28 23:05:48 -0700101)
102
103cc_test(
104 name = "condition_test",
105 srcs = [
106 "condition_test.cc",
107 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800108 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700109 deps = [
110 ":condition",
111 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -0700112 "//aos/ipc_lib:aos_sync",
113 "//aos/ipc_lib:core_lib",
Austin Schuh972e47e2018-12-20 17:20:58 -0800114 "//aos/logging",
115 "//aos/mutex",
John Park33858a32018-09-28 23:05:48 -0700116 "//aos/testing:googletest",
117 "//aos/testing:prevent_exit",
118 "//aos/testing:test_shm",
Austin Schuh972e47e2018-12-20 17:20:58 -0800119 "//aos/time",
John Park33858a32018-09-28 23:05:48 -0700120 ],
121)
122
123cc_library(
124 name = "die",
125 srcs = [
126 "die.cc",
127 ],
128 hdrs = [
129 "die.h",
130 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800131 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800132 visibility = ["//visibility:public"],
John Park33858a32018-09-28 23:05:48 -0700133 deps = [
134 "//aos:macros",
135 "//aos/libc:aos_strerror",
136 ],
John Park33858a32018-09-28 23:05:48 -0700137)
138
John Park33858a32018-09-28 23:05:48 -0700139cc_test(
140 name = "die_test",
141 srcs = [
142 "die_test.cc",
143 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800144 target_compatible_with = ["@platforms//os:linux"],
John Park33858a32018-09-28 23:05:48 -0700145 deps = [
146 ":die",
147 "//aos/testing:googletest",
148 ],
149)
150
John Park398c74a2018-10-20 21:17:39 -0700151cc_binary(
152 name = "dump_rtprio",
153 srcs = [
154 "dump_rtprio.cc",
155 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800156 target_compatible_with = ["@platforms//os:linux"],
John Park398c74a2018-10-20 21:17:39 -0700157 deps = [
Austin Schuh972e47e2018-12-20 17:20:58 -0800158 "//aos/time",
Brian Silverman3eb60d22021-11-04 19:06:47 -0700159 "@com_github_google_glog//:glog",
John Park398c74a2018-10-20 21:17:39 -0700160 ],
161)
162
163cc_library(
John Park398c74a2018-10-20 21:17:39 -0700164 name = "init",
165 srcs = [
166 "init.cc",
167 ],
168 hdrs = [
169 "init.h",
170 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800171 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800172 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700173 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700174 ":realtime",
John Park398c74a2018-10-20 21:17:39 -0700175 "//aos:die",
Austin Schuh972e47e2018-12-20 17:20:58 -0800176 "//aos/logging:implementations",
John Park398c74a2018-10-20 21:17:39 -0700177 ],
John Park398c74a2018-10-20 21:17:39 -0700178)
179
Alex Perrycb7da4b2019-08-28 19:35:56 -0700180cc_library(
181 name = "realtime",
182 srcs = [
183 "realtime.cc",
184 ],
185 hdrs = [
186 "realtime.h",
187 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800188 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700189 visibility = ["//visibility:public"],
190 deps = [
Austin Schuhcc6070c2020-10-10 20:25:56 -0700191 ":thread_local",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700192 "@com_github_google_glog//:glog",
193 ],
194)
195
Austin Schuhcb108412019-10-13 16:09:54 -0700196flatbuffer_cc_library(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700197 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700198 srcs = ["configuration.fbs"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700199 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800200 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700201 visibility = ["//visibility:public"],
Austin Schuhcb108412019-10-13 16:09:54 -0700202)
203
Alex Perryd5e13572020-02-22 15:15:08 -0800204flatbuffer_ts_library(
205 name = "configuration_ts_fbs",
206 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800207 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800208 visibility = ["//visibility:public"],
209)
210
Brian Silverman28760272020-02-02 13:21:51 -0800211flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800212 name = "configuration_fbs_python",
213 srcs = ["configuration.fbs"],
214 namespace = "aos",
215 tables = [
216 "Configuration",
217 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800218 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800219 "Map",
220 "Node",
221 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800222 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800223 visibility = ["//visibility:public"],
224)
225
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700226flatbuffer_rust_library(
227 name = "configuration_rust_fbs",
228 srcs = ["configuration.fbs"],
229 crate_name = "aos_configuration_fbs",
230 target_compatible_with = ["//tools/platforms/rust:has_support"],
231 visibility = ["//visibility:public"],
232)
233
John Park398c74a2018-10-20 21:17:39 -0700234cc_library(
235 name = "configuration",
236 srcs = [
237 "configuration.cc",
238 ],
239 hdrs = [
240 "configuration.h",
241 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800242 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800243 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700244 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700245 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700246 ":flatbuffer_merge",
247 ":flatbuffers",
248 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700249 "//aos:unique_malloc_ptr",
Austin Schuh217a9782019-12-21 23:02:50 -0800250 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700251 "//aos/util:file",
252 "@com_github_google_glog//:glog",
253 "@com_google_absl//absl/container:btree",
254 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700255 ],
John Park398c74a2018-10-20 21:17:39 -0700256)
257
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700258cc_library(
259 name = "configuration_for_rust",
260 srcs = [
261 "configuration_for_rust.cc",
262 ],
263 hdrs = [
264 "configuration_for_rust.h",
265 ],
266 deps = [
267 ":configuration",
268 ":for_rust",
269 "//third_party/cargo:cxx_cc",
270 ],
271)
272
273autocxx_library(
274 name = "configuration_rs",
275 srcs = ["configuration.rs"],
276 crate_name = "aos_configuration",
277 libs = [
278 ":configuration",
279 ":configuration_for_rust",
280 ":configuration_fbs",
281 ],
282 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
283 target_compatible_with = ["//tools/platforms/rust:has_support"],
284 visibility = ["//visibility:public"],
285 deps = [
286 ":configuration_rust_fbs",
287 ":flatbuffers_rs",
288 "//third_party/cargo:thiserror",
289 ],
290)
291
292rust_test(
293 name = "configuration_rs_test",
294 crate = ":configuration_rs",
295 data = [
296 "//aos/testdata:test_configs",
297 ],
298 # TODO: Make Rust play happy with pic vs nopic. Details at:
299 # https://github.com/bazelbuild/rules_rust/issues/118
300 rustc_flags = ["-Crelocation-model=static"],
301)
302
James Kuszmaulabb77132020-08-01 19:56:16 -0700303flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800304 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700305 srcs = ["json_to_flatbuffer.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800306 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700307 visibility = ["//aos:__subpackages__"],
308)
309
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700310flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800311 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700312 srcs = ["json_to_flatbuffer.fbs"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800313 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800314 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700315 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700316)
317
Brian Silvermand1805b62022-07-20 20:47:05 -0700318flatbuffer_rust_library(
319 name = "json_to_flatbuffer_rust_fbs",
320 srcs = ["json_to_flatbuffer.fbs"],
321 crate_name = "aos_json_to_flatbuffer_fbs",
322 target_compatible_with = ["//tools/platforms/rust:has_support"],
323 visibility = ["//aos:__subpackages__"],
324)
325
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700326cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700327 name = "flatbuffer_utils",
328 srcs = ["flatbuffer_utils.cc"],
329 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800330 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700331 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700332 deps = [
333 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800334 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700335 ],
336)
337
338cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700339 name = "json_tokenizer",
340 srcs = ["json_tokenizer.cc"],
341 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800342 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700343 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700344 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700345 "@com_google_absl//absl/strings",
346 ],
347)
348
349cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700350 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800351 srcs = [
352 "flatbuffer_introspection.cc",
353 "json_to_flatbuffer.cc",
354 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700355 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800356 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700357 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700358 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700359 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700360 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700361 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700362 ":json_tokenizer",
Austin Schuhbba10282021-03-20 22:03:28 -0700363 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700364 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700365 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700366 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700367 ],
368)
369
370cc_test(
371 name = "json_to_flatbuffer_test",
372 srcs = [
373 "json_to_flatbuffer_test.cc",
374 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800375 data = [
376 ":json_to_flatbuffer_fbs_reflection_out",
377 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800378 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700379 deps = [
380 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800381 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700382 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700383 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700384 ],
385)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700386
Tyler Chatow5e369a42019-11-23 11:57:31 -0800387cc_test(
388 name = "flatbuffer_introspection_test",
389 srcs = [
390 "flatbuffer_introspection_test.cc",
391 ],
392 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800393 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800394 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800395 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800396 deps = [
397 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800398 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800399 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700400 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800401 "//aos/util:file",
402 "@com_github_google_flatbuffers//:flatbuffers",
403 ],
404)
405
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700406cc_library(
407 name = "flatbuffer_merge",
408 srcs = ["flatbuffer_merge.cc"],
409 hdrs = ["flatbuffer_merge.h"],
410 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800411 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700412 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700413 deps = [
414 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700415 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700416 "@com_github_google_flatbuffers//:flatbuffers",
417 ],
418)
419
420cc_test(
421 name = "flatbuffer_merge_test",
422 srcs = [
423 "flatbuffer_merge_test.cc",
424 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800425 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700426 deps = [
427 ":flatbuffer_merge",
428 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800429 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700430 "//aos/testing:googletest",
431 ],
432)
Austin Schuhe93d8642019-10-13 15:27:07 -0700433
434cc_library(
435 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700436 srcs = [
437 "flatbuffers.cc",
438 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700439 hdrs = [
440 "flatbuffers.h",
441 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800442 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700443 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700444 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800445 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700446 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700447 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700448 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700449 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700450 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800451 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700452 ],
453)
Austin Schuhcb108412019-10-13 16:09:54 -0700454
Brian Silvermand1805b62022-07-20 20:47:05 -0700455rust_library(
456 name = "flatbuffers_rs",
457 srcs = ["flatbuffers.rs"],
458 crate_name = "aos_flatbuffers",
459 target_compatible_with = ["//tools/platforms/rust:has_support"],
460 visibility = ["//visibility:public"],
461 deps = [
462 "@com_github_google_flatbuffers//rust",
463 ],
464)
465
466rust_test(
467 name = "flatbuffers_rs_test",
468 crate = ":flatbuffers_rs",
469 deps = [
470 ":json_to_flatbuffer_rust_fbs",
471 ],
472)
473
Austin Schuhcb108412019-10-13 16:09:54 -0700474cc_test(
475 name = "configuration_test",
476 srcs = [
477 "configuration_test.cc",
478 ],
479 data = [
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700480 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700481 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700482 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700483 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800484 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700485 deps = [
486 ":configuration",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800487 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700488 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700489 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700490 "//aos/testing:test_logging",
491 ],
492)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700493
494cc_binary(
495 name = "config_flattener",
496 srcs = [
497 "config_flattener.cc",
498 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800499 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700500 visibility = ["//visibility:public"],
501 deps = [
502 ":configuration",
503 ":init",
504 "//aos/util:file",
505 "@com_github_google_glog//:glog",
506 ],
507)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800508
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800509cc_library(
510 name = "aos_cli_utils",
511 srcs = [
512 "aos_cli_utils.cc",
513 ],
514 hdrs = [
515 "aos_cli_utils.h",
516 ],
517 target_compatible_with = ["@platforms//os:linux"],
518 visibility = ["//visibility:public"],
519 deps = [
520 ":configuration",
521 "//aos:init",
522 "//aos/events:shm_event_loop",
523 "@com_github_google_glog//:glog",
524 ],
525)
526
Tyler Chatow5e369a42019-11-23 11:57:31 -0800527cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800528 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800529 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800530 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800531 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800532 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800533 visibility = ["//visibility:public"],
534 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800535 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800536 ":configuration",
537 ":json_to_flatbuffer",
538 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800539 "@com_github_google_glog//:glog",
540 ],
541)
542
543cc_binary(
544 name = "aos_send",
545 srcs = [
546 "aos_send.cc",
547 ],
548 target_compatible_with = ["@platforms//os:linux"],
549 visibility = ["//visibility:public"],
550 deps = [
551 ":aos_cli_utils",
552 ":configuration",
553 ":init",
554 ":json_to_flatbuffer",
555 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800556 "@com_github_google_glog//:glog",
557 ],
558)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500559
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700560cc_binary(
561 name = "aos_graph_nodes",
562 srcs = [
563 "aos_graph_nodes.cc",
564 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800565 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700566 visibility = ["//visibility:public"],
567 deps = [
568 ":configuration",
569 ":json_to_flatbuffer",
570 "//aos:init",
571 "//aos/events:shm_event_loop",
572 "@com_github_google_glog//:glog",
573 ],
574)
575
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500576cc_library(
577 name = "ftrace",
578 srcs = [
579 "ftrace.cc",
580 ],
581 hdrs = [
582 "ftrace.h",
583 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800584 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500585 visibility = ["//visibility:public"],
586 deps = [
587 "@com_github_google_glog//:glog",
588 ],
589)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700590
591cc_library(
592 name = "fast_string_builder",
593 srcs = [
594 "fast_string_builder.cc",
595 ],
596 hdrs = [
597 "fast_string_builder.h",
598 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800599 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700600 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700601 deps = [
602 "@com_github_google_glog//:glog",
603 "@com_google_absl//absl/strings",
604 "@com_google_absl//absl/strings:str_format",
605 ],
606)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700607
608cc_library(
609 name = "thread_local",
610 hdrs = [
611 "thread_local.h",
612 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800613 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb47f5552020-10-01 15:08:14 -0700614 visibility = ["//visibility:public"],
615)
Austin Schuhcc6070c2020-10-10 20:25:56 -0700616
617cc_test(
618 name = "realtime_test",
619 srcs = [
620 "realtime_test.cc",
621 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800622 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700623 visibility = ["//visibility:public"],
624 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700625 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700626 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700627 "@com_github_gflags_gflags//:gflags",
628 "@com_github_google_glog//:glog",
629 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700630 ],
631)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800632
633cc_test(
634 name = "flatbuffers_test",
635 srcs = [
636 "flatbuffers_test.cc",
637 ],
638 deps = [
639 ":flatbuffers",
640 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800641 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800642 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700643 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800644 ],
645)
Austin Schuh0de30f32020-12-06 12:44:28 -0800646
647py_binary(
648 name = "flatbuffers_static",
649 srcs = ["flatbuffers_static.py"],
650 visibility = ["//visibility:public"],
651)
Austin Schuh4385b142021-03-14 21:31:13 -0700652
653cc_library(
654 name = "uuid",
655 srcs = ["uuid.cc"],
656 hdrs = ["uuid.h"],
657 target_compatible_with = ["@platforms//os:linux"],
658 visibility = ["//visibility:public"],
659 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700660 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700661 "@com_github_google_flatbuffers//:flatbuffers",
662 "@com_github_google_glog//:glog",
663 "@com_google_absl//absl/types:span",
664 ],
665)
666
667cc_test(
668 name = "uuid_test",
669 srcs = ["uuid_test.cc"],
670 target_compatible_with = ["@platforms//os:linux"],
671 deps = [
672 ":uuid",
673 "//aos/testing:googletest",
674 ],
675)
Austin Schuh30f74292021-08-13 17:25:26 -0700676
677cc_binary(
678 name = "aos_graph_channels",
679 srcs = [
680 "aos_graph_channels.cc",
681 ],
682 target_compatible_with = ["@platforms//os:linux"],
683 deps = [
684 "//aos:configuration",
685 "//aos:init",
686 "//aos:json_to_flatbuffer",
687 "//aos/events:simulated_event_loop",
688 "//aos/events/logging:log_reader",
689 "//aos/time",
690 "@com_github_gflags_gflags//:gflags",
691 "@com_github_google_glog//:glog",
692 ],
693)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700694
695cc_library(
696 name = "for_rust",
697 hdrs = [
698 "for_rust.h",
699 ],
700 visibility = ["//visibility:public"],
701 deps = [
702 "//third_party/cargo:cxx_cc",
703 ],
704)