blob: de6e249fab3dbd1ff82b0f96403196e1d5764031 [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 "starterd",
9 "starter_cmd",
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
14cc_binary(
Austin Schuhdde64052019-12-11 20:28:00 -080015 name = "starter_exe",
16 srcs = [
17 "starter.cc",
18 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080019 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhdde64052019-12-11 20:28:00 -080020 deps = [
21 "//aos:init",
Austin Schuhdde64052019-12-11 20:28:00 -080022 "//aos:unique_malloc_ptr",
23 "//aos/libc:aos_strsignal",
24 "//aos/logging",
25 "//aos/logging:implementations",
26 "//aos/time",
27 "//aos/util:run_command",
28 "//third_party/libevent",
Brian Silverman1463c092020-10-30 17:28:24 -070029 "@com_github_google_glog//:glog",
John Park7bf05bf2019-12-02 21:33:19 -080030 "@com_google_absl//absl/base",
Austin Schuhdde64052019-12-11 20:28:00 -080031 ],
Brian Silverman100534c2015-09-07 15:51:23 -040032)
Tyler Chatowa79419d2020-08-12 20:12:11 -070033
34cc_library(
35 name = "starterd_lib",
36 srcs = ["starterd_lib.cc"],
37 hdrs = ["starterd_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080038 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070039 deps = [
40 ":starter_fbs",
41 ":starter_rpc_fbs",
42 "//aos:configuration",
43 "//aos:macros",
44 "//aos/events:shm_event_loop",
45 "@com_github_google_glog//:glog",
46 ],
47)
48
49cc_test(
50 name = "starter_test",
51 srcs = ["starter_test.cc"],
52 data = [
53 "//aos/events:ping",
54 "//aos/events:pingpong_config",
55 "//aos/events:pong",
56 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080057 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070058 deps = [
59 ":starter_rpc_lib",
60 ":starterd_lib",
61 "//aos/events:ping_fbs",
62 "//aos/events:pong_fbs",
63 "//aos/testing:googletest",
64 "//aos/testing:tmpdir",
65 ],
66)
67
68cc_binary(
69 name = "starterd",
70 srcs = ["starterd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080071 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070072 deps = [
73 ":starterd_lib",
74 "//aos:init",
75 ],
76)
77
78cc_library(
79 name = "starter_rpc_lib",
80 srcs = ["starter_rpc_lib.cc"],
81 hdrs = ["starter_rpc_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080082 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070083 deps = [
84 ":starter_fbs",
85 ":starter_rpc_fbs",
86 "//aos:configuration",
87 "//aos:init",
88 "//aos/events:shm_event_loop",
89 ],
90)
91
92cc_binary(
93 name = "starter_cmd",
94 srcs = ["starter_cmd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080095 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070096 deps = [
97 ":starter_rpc_lib",
98 "@com_github_google_glog//:glog",
Philipp Schrader08537492021-01-23 16:17:55 -080099 "@com_google_absl//absl/strings:str_format",
Tyler Chatowa79419d2020-08-12 20:12:11 -0700100 ],
101)
102
103flatbuffer_cc_library(
104 name = "starter_fbs",
105 srcs = ["starter.fbs"],
106 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800107 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -0700108 visibility = ["//visibility:public"],
109)
110
111flatbuffer_cc_library(
112 name = "starter_rpc_fbs",
113 srcs = ["starter_rpc.fbs"],
114 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800115 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -0700116 visibility = ["//visibility:public"],
117)