blob: b7aef8863955e96217c8ae10db8646e384c4613c [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 = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700344 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700345 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700346 "@com_google_absl//absl/strings",
347 ],
348)
349
350cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700351 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800352 srcs = [
353 "flatbuffer_introspection.cc",
354 "json_to_flatbuffer.cc",
355 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700356 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800357 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700358 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700359 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700360 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700361 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700362 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700363 ":json_tokenizer",
Austin Schuhbba10282021-03-20 22:03:28 -0700364 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700365 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700366 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700367 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700368 ],
369)
370
371cc_test(
372 name = "json_to_flatbuffer_test",
373 srcs = [
374 "json_to_flatbuffer_test.cc",
375 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800376 data = [
377 ":json_to_flatbuffer_fbs_reflection_out",
378 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800379 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700380 deps = [
381 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800382 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700383 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700384 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700385 ],
386)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700387
Tyler Chatow5e369a42019-11-23 11:57:31 -0800388cc_test(
389 name = "flatbuffer_introspection_test",
390 srcs = [
391 "flatbuffer_introspection_test.cc",
392 ],
393 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800394 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800395 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800396 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800397 deps = [
398 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800399 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800400 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700401 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800402 "//aos/util:file",
403 "@com_github_google_flatbuffers//:flatbuffers",
404 ],
405)
406
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700407cc_library(
408 name = "flatbuffer_merge",
409 srcs = ["flatbuffer_merge.cc"],
410 hdrs = ["flatbuffer_merge.h"],
411 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800412 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700413 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700414 deps = [
415 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700416 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700417 "@com_github_google_flatbuffers//:flatbuffers",
418 ],
419)
420
421cc_test(
422 name = "flatbuffer_merge_test",
423 srcs = [
424 "flatbuffer_merge_test.cc",
425 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800426 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700427 deps = [
428 ":flatbuffer_merge",
429 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800430 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700431 "//aos/testing:googletest",
432 ],
433)
Austin Schuhe93d8642019-10-13 15:27:07 -0700434
435cc_library(
436 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700437 srcs = [
438 "flatbuffers.cc",
439 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700440 hdrs = [
441 "flatbuffers.h",
442 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800443 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700444 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700445 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800446 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700447 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700448 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700449 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700450 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700451 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800452 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700453 ],
454)
Austin Schuhcb108412019-10-13 16:09:54 -0700455
Brian Silvermand1805b62022-07-20 20:47:05 -0700456rust_library(
457 name = "flatbuffers_rs",
458 srcs = ["flatbuffers.rs"],
459 crate_name = "aos_flatbuffers",
460 target_compatible_with = ["//tools/platforms/rust:has_support"],
461 visibility = ["//visibility:public"],
462 deps = [
463 "@com_github_google_flatbuffers//rust",
464 ],
465)
466
467rust_test(
468 name = "flatbuffers_rs_test",
469 crate = ":flatbuffers_rs",
470 deps = [
471 ":json_to_flatbuffer_rust_fbs",
472 ],
473)
474
Austin Schuhcb108412019-10-13 16:09:54 -0700475cc_test(
476 name = "configuration_test",
477 srcs = [
478 "configuration_test.cc",
479 ],
480 data = [
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700481 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700482 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700483 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700484 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800485 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700486 deps = [
487 ":configuration",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800488 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700489 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700490 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700491 "//aos/testing:test_logging",
492 ],
493)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700494
495cc_binary(
496 name = "config_flattener",
497 srcs = [
498 "config_flattener.cc",
499 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800500 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700501 visibility = ["//visibility:public"],
502 deps = [
503 ":configuration",
504 ":init",
505 "//aos/util:file",
506 "@com_github_google_glog//:glog",
507 ],
508)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800509
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800510cc_library(
511 name = "aos_cli_utils",
512 srcs = [
513 "aos_cli_utils.cc",
514 ],
515 hdrs = [
516 "aos_cli_utils.h",
517 ],
518 target_compatible_with = ["@platforms//os:linux"],
519 visibility = ["//visibility:public"],
520 deps = [
521 ":configuration",
522 "//aos:init",
523 "//aos/events:shm_event_loop",
524 "@com_github_google_glog//:glog",
525 ],
526)
527
Tyler Chatow5e369a42019-11-23 11:57:31 -0800528cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800529 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800530 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800531 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800532 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800533 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800534 visibility = ["//visibility:public"],
535 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800536 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800537 ":configuration",
538 ":json_to_flatbuffer",
539 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800540 "@com_github_google_glog//:glog",
541 ],
542)
543
544cc_binary(
545 name = "aos_send",
546 srcs = [
547 "aos_send.cc",
548 ],
549 target_compatible_with = ["@platforms//os:linux"],
550 visibility = ["//visibility:public"],
551 deps = [
552 ":aos_cli_utils",
553 ":configuration",
554 ":init",
555 ":json_to_flatbuffer",
556 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800557 "@com_github_google_glog//:glog",
558 ],
559)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500560
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700561cc_binary(
562 name = "aos_graph_nodes",
563 srcs = [
564 "aos_graph_nodes.cc",
565 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800566 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700567 visibility = ["//visibility:public"],
568 deps = [
569 ":configuration",
570 ":json_to_flatbuffer",
571 "//aos:init",
572 "//aos/events:shm_event_loop",
573 "@com_github_google_glog//:glog",
574 ],
575)
576
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500577cc_library(
578 name = "ftrace",
579 srcs = [
580 "ftrace.cc",
581 ],
582 hdrs = [
583 "ftrace.h",
584 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800585 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500586 visibility = ["//visibility:public"],
587 deps = [
588 "@com_github_google_glog//:glog",
589 ],
590)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700591
592cc_library(
593 name = "fast_string_builder",
594 srcs = [
595 "fast_string_builder.cc",
596 ],
597 hdrs = [
598 "fast_string_builder.h",
599 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800600 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700601 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700602 deps = [
603 "@com_github_google_glog//:glog",
604 "@com_google_absl//absl/strings",
605 "@com_google_absl//absl/strings:str_format",
606 ],
607)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700608
609cc_library(
610 name = "thread_local",
611 hdrs = [
612 "thread_local.h",
613 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800614 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb47f5552020-10-01 15:08:14 -0700615 visibility = ["//visibility:public"],
616)
Austin Schuhcc6070c2020-10-10 20:25:56 -0700617
618cc_test(
619 name = "realtime_test",
620 srcs = [
621 "realtime_test.cc",
622 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800623 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700624 visibility = ["//visibility:public"],
625 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700626 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700627 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700628 "@com_github_gflags_gflags//:gflags",
629 "@com_github_google_glog//:glog",
630 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700631 ],
632)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800633
634cc_test(
635 name = "flatbuffers_test",
636 srcs = [
637 "flatbuffers_test.cc",
638 ],
639 deps = [
640 ":flatbuffers",
641 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800642 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800643 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700644 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800645 ],
646)
Austin Schuh0de30f32020-12-06 12:44:28 -0800647
648py_binary(
649 name = "flatbuffers_static",
650 srcs = ["flatbuffers_static.py"],
651 visibility = ["//visibility:public"],
652)
Austin Schuh4385b142021-03-14 21:31:13 -0700653
654cc_library(
655 name = "uuid",
656 srcs = ["uuid.cc"],
657 hdrs = ["uuid.h"],
658 target_compatible_with = ["@platforms//os:linux"],
659 visibility = ["//visibility:public"],
660 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700661 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700662 "@com_github_google_flatbuffers//:flatbuffers",
663 "@com_github_google_glog//:glog",
664 "@com_google_absl//absl/types:span",
665 ],
666)
667
668cc_test(
669 name = "uuid_test",
670 srcs = ["uuid_test.cc"],
671 target_compatible_with = ["@platforms//os:linux"],
672 deps = [
673 ":uuid",
674 "//aos/testing:googletest",
675 ],
676)
Austin Schuh30f74292021-08-13 17:25:26 -0700677
678cc_binary(
679 name = "aos_graph_channels",
680 srcs = [
681 "aos_graph_channels.cc",
682 ],
683 target_compatible_with = ["@platforms//os:linux"],
684 deps = [
685 "//aos:configuration",
686 "//aos:init",
687 "//aos:json_to_flatbuffer",
688 "//aos/events:simulated_event_loop",
689 "//aos/events/logging:log_reader",
690 "//aos/time",
691 "@com_github_gflags_gflags//:gflags",
692 "@com_github_google_glog//:glog",
693 ],
694)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700695
696cc_library(
697 name = "for_rust",
698 hdrs = [
699 "for_rust.h",
700 ],
701 visibility = ["//visibility:public"],
702 deps = [
703 "//third_party/cargo:cxx_cc",
704 ],
705)