blob: 52fd62a4e7b159aa0462b877e87f70acb5076fad [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",
8 "starter_exe",
9 ],
10 visibility = ["//visibility:public"],
Brian Silverman96d12952015-10-12 13:36:42 -040011)
Brian Silverman100534c2015-09-07 15:51:23 -040012
13cc_binary(
Austin Schuhdde64052019-12-11 20:28:00 -080014 name = "starter_exe",
15 srcs = [
16 "starter.cc",
17 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080018 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhdde64052019-12-11 20:28:00 -080019 deps = [
20 "//aos:init",
Austin Schuhdde64052019-12-11 20:28:00 -080021 "//aos:unique_malloc_ptr",
22 "//aos/libc:aos_strsignal",
23 "//aos/logging",
24 "//aos/logging:implementations",
25 "//aos/time",
26 "//aos/util:run_command",
27 "//third_party/libevent",
Brian Silverman1463c092020-10-30 17:28:24 -070028 "@com_github_google_glog//:glog",
John Park7bf05bf2019-12-02 21:33:19 -080029 "@com_google_absl//absl/base",
Austin Schuhdde64052019-12-11 20:28:00 -080030 ],
Brian Silverman100534c2015-09-07 15:51:23 -040031)
Tyler Chatowa79419d2020-08-12 20:12:11 -070032
33cc_library(
34 name = "starterd_lib",
35 srcs = ["starterd_lib.cc"],
36 hdrs = ["starterd_lib.h"],
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_fbs",
40 ":starter_rpc_fbs",
41 "//aos:configuration",
42 "//aos:macros",
43 "//aos/events:shm_event_loop",
44 "@com_github_google_glog//:glog",
45 ],
46)
47
48cc_test(
49 name = "starter_test",
50 srcs = ["starter_test.cc"],
51 data = [
52 "//aos/events:ping",
53 "//aos/events:pingpong_config",
54 "//aos/events:pong",
55 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080056 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070057 deps = [
58 ":starter_rpc_lib",
59 ":starterd_lib",
60 "//aos/events:ping_fbs",
61 "//aos/events:pong_fbs",
62 "//aos/testing:googletest",
63 "//aos/testing:tmpdir",
64 ],
65)
66
67cc_binary(
68 name = "starterd",
69 srcs = ["starterd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080070 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070071 deps = [
72 ":starterd_lib",
73 "//aos:init",
74 ],
75)
76
77cc_library(
78 name = "starter_rpc_lib",
79 srcs = ["starter_rpc_lib.cc"],
80 hdrs = ["starter_rpc_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080081 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070082 deps = [
83 ":starter_fbs",
84 ":starter_rpc_fbs",
85 "//aos:configuration",
86 "//aos:init",
87 "//aos/events:shm_event_loop",
88 ],
89)
90
91cc_binary(
92 name = "starter_cmd",
93 srcs = ["starter_cmd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080094 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070095 deps = [
96 ":starter_rpc_lib",
97 "@com_github_google_glog//:glog",
98 ],
99)
100
101flatbuffer_cc_library(
102 name = "starter_fbs",
103 srcs = ["starter.fbs"],
104 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800105 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -0700106 visibility = ["//visibility:public"],
107)
108
109flatbuffer_cc_library(
110 name = "starter_rpc_fbs",
111 srcs = ["starter_rpc.fbs"],
112 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800113 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -0700114 visibility = ["//visibility:public"],
115)