blob: fa62a8766126c9c3846e9490de271853d1a91b56 [file] [log] [blame]
Tyler Chatowa79419d2020-08-12 20:12:11 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
2
Brian Silverman96d12952015-10-12 13:36:42 -04003# This target is everything which should get deployed to the robot.
4filegroup(
Austin Schuhdde64052019-12-11 20:28:00 -08005 name = "starter",
6 srcs = [
7 "starter.sh",
Tyler Chatow03fdb2a2020-12-26 18:39:36 -08008 "starter_cmd",
Austin Schuh1bd52e22021-02-07 22:14:56 -08009 "starterd",
Austin Schuhdde64052019-12-11 20:28:00 -080010 ],
11 visibility = ["//visibility:public"],
Brian Silverman96d12952015-10-12 13:36:42 -040012)
Brian Silverman100534c2015-09-07 15:51:23 -040013
Tyler Chatowa79419d2020-08-12 20:12:11 -070014cc_library(
15 name = "starterd_lib",
16 srcs = ["starterd_lib.cc"],
17 hdrs = ["starterd_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080018 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070019 deps = [
20 ":starter_fbs",
21 ":starter_rpc_fbs",
22 "//aos:configuration",
23 "//aos:macros",
24 "//aos/events:shm_event_loop",
25 "@com_github_google_glog//:glog",
26 ],
27)
28
29cc_test(
30 name = "starter_test",
31 srcs = ["starter_test.cc"],
32 data = [
33 "//aos/events:ping",
34 "//aos/events:pingpong_config",
35 "//aos/events:pong",
36 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080037 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070038 deps = [
39 ":starter_rpc_lib",
40 ":starterd_lib",
41 "//aos/events:ping_fbs",
42 "//aos/events:pong_fbs",
43 "//aos/testing:googletest",
44 "//aos/testing:tmpdir",
45 ],
46)
47
48cc_binary(
49 name = "starterd",
50 srcs = ["starterd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080051 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070052 deps = [
53 ":starterd_lib",
54 "//aos:init",
55 ],
56)
57
58cc_library(
59 name = "starter_rpc_lib",
60 srcs = ["starter_rpc_lib.cc"],
61 hdrs = ["starter_rpc_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080062 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070063 deps = [
64 ":starter_fbs",
65 ":starter_rpc_fbs",
66 "//aos:configuration",
67 "//aos:init",
68 "//aos/events:shm_event_loop",
69 ],
70)
71
72cc_binary(
73 name = "starter_cmd",
74 srcs = ["starter_cmd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070076 deps = [
77 ":starter_rpc_lib",
Austin Schuhc61e9c02021-04-26 12:10:40 -070078 "//aos/time",
Tyler Chatowa79419d2020-08-12 20:12:11 -070079 "@com_github_google_glog//:glog",
Philipp Schrader08537492021-01-23 16:17:55 -080080 "@com_google_absl//absl/strings:str_format",
Tyler Chatowa79419d2020-08-12 20:12:11 -070081 ],
82)
83
84flatbuffer_cc_library(
85 name = "starter_fbs",
86 srcs = ["starter.fbs"],
87 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -080088 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070089 visibility = ["//visibility:public"],
90)
91
92flatbuffer_cc_library(
93 name = "starter_rpc_fbs",
94 srcs = ["starter_rpc.fbs"],
95 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -080096 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070097 visibility = ["//visibility:public"],
98)