blob: a1c92e7172dbf8a9611b40152de5ec5c36ff8563 [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
Alex Perrycb7da4b2019-08-28 19:35:56 -0700181cc_library(
182 name = "realtime",
183 srcs = [
184 "realtime.cc",
185 ],
186 hdrs = [
187 "realtime.h",
188 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800189 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700190 visibility = ["//visibility:public"],
191 deps = [
Austin Schuhcc6070c2020-10-10 20:25:56 -0700192 ":thread_local",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700193 "@com_github_google_glog//:glog",
194 ],
195)
196
Austin Schuhcb108412019-10-13 16:09:54 -0700197flatbuffer_cc_library(
Alex Perrycb7da4b2019-08-28 19:35:56 -0700198 name = "configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700199 srcs = ["configuration.fbs"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700200 gen_reflections = 1,
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"],
Austin Schuhcb108412019-10-13 16:09:54 -0700203)
204
James Kuszmaule4aa01d2022-06-28 14:09:02 -0700205cc_static_flatbuffer(
206 name = "configuration_schema",
207 function = "aos::ConfigurationSchema",
208 target = ":configuration_fbs_reflection_out",
209 visibility = ["//visibility:public"],
210)
211
Alex Perryd5e13572020-02-22 15:15:08 -0800212flatbuffer_ts_library(
213 name = "configuration_ts_fbs",
214 srcs = ["configuration.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800215 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -0800216 visibility = ["//visibility:public"],
217)
218
Brian Silverman28760272020-02-02 13:21:51 -0800219flatbuffer_py_library(
James Kuszmaul7daef362019-12-31 18:28:17 -0800220 name = "configuration_fbs_python",
221 srcs = ["configuration.fbs"],
222 namespace = "aos",
223 tables = [
224 "Configuration",
225 "Channel",
James Kuszmaul84ff3e52020-01-03 19:48:53 -0800226 "Connection",
James Kuszmaul7daef362019-12-31 18:28:17 -0800227 "Map",
228 "Node",
229 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800230 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul7daef362019-12-31 18:28:17 -0800231 visibility = ["//visibility:public"],
232)
233
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700234flatbuffer_rust_library(
235 name = "configuration_rust_fbs",
236 srcs = ["configuration.fbs"],
237 crate_name = "aos_configuration_fbs",
238 target_compatible_with = ["//tools/platforms/rust:has_support"],
239 visibility = ["//visibility:public"],
240)
241
John Park398c74a2018-10-20 21:17:39 -0700242cc_library(
243 name = "configuration",
244 srcs = [
245 "configuration.cc",
246 ],
247 hdrs = [
248 "configuration.h",
249 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800250 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh972e47e2018-12-20 17:20:58 -0800251 visibility = ["//visibility:public"],
John Park398c74a2018-10-20 21:17:39 -0700252 deps = [
Alex Perrycb7da4b2019-08-28 19:35:56 -0700253 ":configuration_fbs",
Austin Schuhcb108412019-10-13 16:09:54 -0700254 ":flatbuffer_merge",
255 ":flatbuffers",
256 ":json_to_flatbuffer",
John Park398c74a2018-10-20 21:17:39 -0700257 "//aos:unique_malloc_ptr",
Austin Schuh217a9782019-12-21 23:02:50 -0800258 "//aos/network:team_number",
Austin Schuhcb108412019-10-13 16:09:54 -0700259 "//aos/util:file",
260 "@com_github_google_glog//:glog",
261 "@com_google_absl//absl/container:btree",
262 "@com_google_absl//absl/strings",
John Park398c74a2018-10-20 21:17:39 -0700263 ],
John Park398c74a2018-10-20 21:17:39 -0700264)
265
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700266cc_library(
267 name = "configuration_for_rust",
268 srcs = [
269 "configuration_for_rust.cc",
270 ],
271 hdrs = [
272 "configuration_for_rust.h",
273 ],
274 deps = [
275 ":configuration",
276 ":for_rust",
277 "//third_party/cargo:cxx_cc",
278 ],
279)
280
281autocxx_library(
282 name = "configuration_rs",
283 srcs = ["configuration.rs"],
284 crate_name = "aos_configuration",
285 libs = [
286 ":configuration",
287 ":configuration_for_rust",
288 ":configuration_fbs",
289 ],
290 override_cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
291 target_compatible_with = ["//tools/platforms/rust:has_support"],
292 visibility = ["//visibility:public"],
293 deps = [
294 ":configuration_rust_fbs",
295 ":flatbuffers_rs",
296 "//third_party/cargo:thiserror",
297 ],
298)
299
300rust_test(
301 name = "configuration_rs_test",
302 crate = ":configuration_rs",
303 data = [
304 "//aos/testdata:test_configs",
305 ],
306 # TODO: Make Rust play happy with pic vs nopic. Details at:
307 # https://github.com/bazelbuild/rules_rust/issues/118
308 rustc_flags = ["-Crelocation-model=static"],
309)
310
James Kuszmaulabb77132020-08-01 19:56:16 -0700311flatbuffer_ts_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800312 name = "json_to_flatbuffer_fbs_ts",
James Kuszmaulabb77132020-08-01 19:56:16 -0700313 srcs = ["json_to_flatbuffer.fbs"],
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__"],
316)
317
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700318flatbuffer_cc_library(
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800319 name = "json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700320 srcs = ["json_to_flatbuffer.fbs"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800321 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -0800322 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaulabb77132020-08-01 19:56:16 -0700323 visibility = ["//aos:__subpackages__"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700324)
325
Brian Silvermand1805b62022-07-20 20:47:05 -0700326flatbuffer_rust_library(
327 name = "json_to_flatbuffer_rust_fbs",
328 srcs = ["json_to_flatbuffer.fbs"],
329 crate_name = "aos_json_to_flatbuffer_fbs",
330 target_compatible_with = ["//tools/platforms/rust:has_support"],
331 visibility = ["//aos:__subpackages__"],
332)
333
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700334cc_library(
Austin Schuh43c6a352019-09-30 22:22:10 -0700335 name = "flatbuffer_utils",
336 srcs = ["flatbuffer_utils.cc"],
337 hdrs = ["flatbuffer_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800338 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700339 visibility = ["//visibility:public"],
Austin Schuh43c6a352019-09-30 22:22:10 -0700340 deps = [
341 "@com_github_google_flatbuffers//:flatbuffers",
Brian Silvermancf4fb662021-02-10 17:54:53 -0800342 "@com_github_google_glog//:glog",
Austin Schuh43c6a352019-09-30 22:22:10 -0700343 ],
344)
345
346cc_library(
Austin Schuhd7e252d2019-10-06 13:51:02 -0700347 name = "json_tokenizer",
348 srcs = ["json_tokenizer.cc"],
349 hdrs = ["json_tokenizer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800350 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhd7e252d2019-10-06 13:51:02 -0700351 deps = [
Pallavi Madhukare2eb2812022-07-19 09:56:09 -0700352 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700353 "@com_github_google_glog//:glog",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700354 "@com_google_absl//absl/strings",
355 ],
356)
357
358cc_library(
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700359 name = "json_to_flatbuffer",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800360 srcs = [
361 "flatbuffer_introspection.cc",
362 "json_to_flatbuffer.cc",
363 ],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700364 hdrs = ["json_to_flatbuffer.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800365 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700366 visibility = ["//visibility:public"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700367 deps = [
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700368 ":fast_string_builder",
Austin Schuh43c6a352019-09-30 22:22:10 -0700369 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700370 ":flatbuffers",
Austin Schuhd7e252d2019-10-06 13:51:02 -0700371 ":json_tokenizer",
Austin Schuhbba10282021-03-20 22:03:28 -0700372 "//aos/util:file",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700373 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuhe93d8642019-10-13 15:27:07 -0700374 "@com_github_google_glog//:glog",
Austin Schuhd339a9b2019-10-05 21:33:32 -0700375 "@com_google_absl//absl/strings",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700376 ],
377)
378
379cc_test(
380 name = "json_to_flatbuffer_test",
381 srcs = [
382 "json_to_flatbuffer_test.cc",
383 ],
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800384 data = [
385 ":json_to_flatbuffer_fbs_reflection_out",
386 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800387 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700388 deps = [
389 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800390 ":json_to_flatbuffer_fbs",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700391 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700392 "//aos/testing:path",
Austin Schuh3e95e5d2019-09-20 00:08:54 -0700393 ],
394)
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700395
Tyler Chatow5e369a42019-11-23 11:57:31 -0800396cc_test(
397 name = "flatbuffer_introspection_test",
398 srcs = [
399 "flatbuffer_introspection_test.cc",
400 ],
401 data = [
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800402 ":json_to_flatbuffer_fbs_reflection_out",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800403 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800404 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800405 deps = [
406 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800407 ":json_to_flatbuffer_fbs",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800408 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700409 "//aos/testing:path",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800410 "//aos/util:file",
411 "@com_github_google_flatbuffers//:flatbuffers",
412 ],
413)
414
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700415cc_library(
416 name = "flatbuffer_merge",
417 srcs = ["flatbuffer_merge.cc"],
418 hdrs = ["flatbuffer_merge.h"],
419 copts = ["-Wno-cast-align"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800420 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700421 visibility = ["//visibility:public"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700422 deps = [
423 ":flatbuffer_utils",
Austin Schuhe93d8642019-10-13 15:27:07 -0700424 ":flatbuffers",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700425 "@com_github_google_flatbuffers//:flatbuffers",
426 ],
427)
428
429cc_test(
430 name = "flatbuffer_merge_test",
431 srcs = [
432 "flatbuffer_merge_test.cc",
433 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800434 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700435 deps = [
436 ":flatbuffer_merge",
437 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800438 ":json_to_flatbuffer_fbs",
Austin Schuh09d7ffa2019-10-03 23:43:34 -0700439 "//aos/testing:googletest",
440 ],
441)
Austin Schuhe93d8642019-10-13 15:27:07 -0700442
443cc_library(
444 name = "flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700445 srcs = [
446 "flatbuffers.cc",
447 ],
Austin Schuhe93d8642019-10-13 15:27:07 -0700448 hdrs = [
449 "flatbuffers.h",
450 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800451 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh40485ed2019-10-26 21:51:44 -0700452 visibility = ["//visibility:public"],
Austin Schuhe93d8642019-10-13 15:27:07 -0700453 deps = [
James Kuszmaulad8a8082020-02-14 21:21:58 -0800454 "//aos:macros",
Brian Silverman354697a2020-09-22 21:06:32 -0700455 "//aos/containers:resizeable_buffer",
davidjevans8b9b52f2021-09-17 08:57:30 -0700456 "//aos/util:file",
Austin Schuhe93d8642019-10-13 15:27:07 -0700457 "@com_github_google_flatbuffers//:flatbuffers",
Austin Schuh40485ed2019-10-26 21:51:44 -0700458 "@com_github_google_glog//:glog",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700459 "@com_google_absl//absl/strings",
Austin Schuh6f3babe2020-01-26 20:34:50 -0800460 "@com_google_absl//absl/types:span",
Austin Schuhe93d8642019-10-13 15:27:07 -0700461 ],
462)
Austin Schuhcb108412019-10-13 16:09:54 -0700463
Brian Silvermand1805b62022-07-20 20:47:05 -0700464rust_library(
465 name = "flatbuffers_rs",
466 srcs = ["flatbuffers.rs"],
467 crate_name = "aos_flatbuffers",
468 target_compatible_with = ["//tools/platforms/rust:has_support"],
469 visibility = ["//visibility:public"],
470 deps = [
471 "@com_github_google_flatbuffers//rust",
472 ],
473)
474
475rust_test(
476 name = "flatbuffers_rs_test",
477 crate = ":flatbuffers_rs",
478 deps = [
479 ":json_to_flatbuffer_rust_fbs",
480 ],
481)
482
Austin Schuhcb108412019-10-13 16:09:54 -0700483cc_test(
484 name = "configuration_test",
485 srcs = [
486 "configuration_test.cc",
487 ],
488 data = [
Austin Schuh14d7d3d2020-09-10 18:14:36 -0700489 "//aos/events:pingpong_config",
Brian Silvermandae15a12022-07-23 12:55:20 -0700490 "//aos/events:pong_fbs_reflection_out",
James Kuszmaulc0c08da2020-05-10 18:56:07 -0700491 "//aos/testdata:test_configs",
Austin Schuhcb108412019-10-13 16:09:54 -0700492 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800493 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcb108412019-10-13 16:09:54 -0700494 deps = [
495 ":configuration",
Austin Schuh1ef01ef2021-02-07 20:40:36 -0800496 "//aos/testing:flatbuffer_eq",
Austin Schuhcb108412019-10-13 16:09:54 -0700497 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700498 "//aos/testing:path",
Austin Schuhcb108412019-10-13 16:09:54 -0700499 "//aos/testing:test_logging",
500 ],
501)
Alex Perrycb7da4b2019-08-28 19:35:56 -0700502
503cc_binary(
504 name = "config_flattener",
505 srcs = [
506 "config_flattener.cc",
507 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800508 target_compatible_with = ["@platforms//os:linux"],
Alex Perrycb7da4b2019-08-28 19:35:56 -0700509 visibility = ["//visibility:public"],
510 deps = [
511 ":configuration",
512 ":init",
513 "//aos/util:file",
514 "@com_github_google_glog//:glog",
515 ],
516)
Tyler Chatow5e369a42019-11-23 11:57:31 -0800517
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800518cc_library(
519 name = "aos_cli_utils",
520 srcs = [
521 "aos_cli_utils.cc",
522 ],
523 hdrs = [
524 "aos_cli_utils.h",
525 ],
526 target_compatible_with = ["@platforms//os:linux"],
527 visibility = ["//visibility:public"],
528 deps = [
529 ":configuration",
530 "//aos:init",
531 "//aos/events:shm_event_loop",
532 "@com_github_google_glog//:glog",
533 ],
534)
535
Tyler Chatow5e369a42019-11-23 11:57:31 -0800536cc_binary(
Austin Schuh944df342019-12-21 17:08:55 -0800537 name = "aos_dump",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800538 srcs = [
Austin Schuh944df342019-12-21 17:08:55 -0800539 "aos_dump.cc",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800540 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800541 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatow5e369a42019-11-23 11:57:31 -0800542 visibility = ["//visibility:public"],
543 deps = [
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800544 ":aos_cli_utils",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800545 ":configuration",
546 ":json_to_flatbuffer",
547 "//aos:init",
Brian Silvermanea2c95f2021-02-10 18:10:26 -0800548 "@com_github_google_glog//:glog",
549 ],
550)
551
552cc_binary(
553 name = "aos_send",
554 srcs = [
555 "aos_send.cc",
556 ],
557 target_compatible_with = ["@platforms//os:linux"],
558 visibility = ["//visibility:public"],
559 deps = [
560 ":aos_cli_utils",
561 ":configuration",
562 ":init",
563 ":json_to_flatbuffer",
564 "@com_github_gflags_gflags//:gflags",
Tyler Chatow5e369a42019-11-23 11:57:31 -0800565 "@com_github_google_glog//:glog",
566 ],
567)
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500568
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700569cc_binary(
570 name = "aos_graph_nodes",
571 srcs = [
572 "aos_graph_nodes.cc",
573 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800574 target_compatible_with = ["@platforms//os:linux"],
Jim Ostrowski17ce54d2020-10-24 17:24:01 -0700575 visibility = ["//visibility:public"],
576 deps = [
577 ":configuration",
578 ":json_to_flatbuffer",
579 "//aos:init",
580 "//aos/events:shm_event_loop",
581 "@com_github_google_glog//:glog",
582 ],
583)
584
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500585cc_library(
586 name = "ftrace",
587 srcs = [
588 "ftrace.cc",
589 ],
590 hdrs = [
591 "ftrace.h",
592 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800593 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman79ec7fc2020-06-08 20:11:22 -0500594 visibility = ["//visibility:public"],
595 deps = [
596 "@com_github_google_glog//:glog",
597 ],
598)
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700599
600cc_library(
601 name = "fast_string_builder",
602 srcs = [
603 "fast_string_builder.cc",
604 ],
605 hdrs = [
606 "fast_string_builder.h",
607 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800608 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul4ed5fb12022-03-22 15:20:04 -0700609 visibility = ["//visibility:public"],
Tyler Chatowfcf16f42020-07-26 12:41:36 -0700610 deps = [
611 "@com_github_google_glog//:glog",
612 "@com_google_absl//absl/strings",
613 "@com_google_absl//absl/strings:str_format",
614 ],
615)
Brian Silvermanb47f5552020-10-01 15:08:14 -0700616
617cc_library(
618 name = "thread_local",
619 hdrs = [
620 "thread_local.h",
621 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800622 target_compatible_with = ["@platforms//os:linux"],
Brian Silvermanb47f5552020-10-01 15:08:14 -0700623 visibility = ["//visibility:public"],
624)
Austin Schuhcc6070c2020-10-10 20:25:56 -0700625
626cc_test(
627 name = "realtime_test",
628 srcs = [
629 "realtime_test.cc",
630 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800631 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhcc6070c2020-10-10 20:25:56 -0700632 visibility = ["//visibility:public"],
633 deps = [
Austin Schuh77f3f222022-06-10 16:49:21 -0700634 ":init",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700635 ":realtime",
Austin Schuh77f3f222022-06-10 16:49:21 -0700636 "@com_github_gflags_gflags//:gflags",
637 "@com_github_google_glog//:glog",
638 "@com_google_googletest//:gtest",
Austin Schuhcc6070c2020-10-10 20:25:56 -0700639 ],
640)
Austin Schuh977a5ed2020-12-02 23:20:04 -0800641
642cc_test(
643 name = "flatbuffers_test",
644 srcs = [
645 "flatbuffers_test.cc",
646 ],
647 deps = [
648 ":flatbuffers",
649 ":json_to_flatbuffer",
Brian Silvermanc5105ab2021-02-10 17:55:38 -0800650 ":json_to_flatbuffer_fbs",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800651 "//aos/testing:googletest",
davidjevans8b9b52f2021-09-17 08:57:30 -0700652 "//aos/testing:tmpdir",
Austin Schuh977a5ed2020-12-02 23:20:04 -0800653 ],
654)
Austin Schuh0de30f32020-12-06 12:44:28 -0800655
656py_binary(
657 name = "flatbuffers_static",
658 srcs = ["flatbuffers_static.py"],
659 visibility = ["//visibility:public"],
660)
Austin Schuh4385b142021-03-14 21:31:13 -0700661
662cc_library(
663 name = "uuid",
664 srcs = ["uuid.cc"],
665 hdrs = ["uuid.h"],
666 target_compatible_with = ["@platforms//os:linux"],
667 visibility = ["//visibility:public"],
668 deps = [
Austin Schuh8902fa52021-03-14 22:39:24 -0700669 "@com_github_gflags_gflags//:gflags",
Austin Schuh4385b142021-03-14 21:31:13 -0700670 "@com_github_google_flatbuffers//:flatbuffers",
671 "@com_github_google_glog//:glog",
672 "@com_google_absl//absl/types:span",
673 ],
674)
675
676cc_test(
677 name = "uuid_test",
678 srcs = ["uuid_test.cc"],
679 target_compatible_with = ["@platforms//os:linux"],
680 deps = [
681 ":uuid",
682 "//aos/testing:googletest",
683 ],
684)
Austin Schuh30f74292021-08-13 17:25:26 -0700685
686cc_binary(
687 name = "aos_graph_channels",
688 srcs = [
689 "aos_graph_channels.cc",
690 ],
691 target_compatible_with = ["@platforms//os:linux"],
692 deps = [
693 "//aos:configuration",
694 "//aos:init",
695 "//aos:json_to_flatbuffer",
696 "//aos/events:simulated_event_loop",
697 "//aos/events/logging:log_reader",
698 "//aos/time",
699 "@com_github_gflags_gflags//:gflags",
700 "@com_github_google_glog//:glog",
701 ],
702)
Brian Silverman7edd1ce2022-07-23 16:10:54 -0700703
704cc_library(
705 name = "for_rust",
706 hdrs = [
707 "for_rust.h",
708 ],
709 visibility = ["//visibility:public"],
710 deps = [
711 "//third_party/cargo:cxx_cc",
712 ],
713)