blob: 91061e312fa4a8cdc9c5caa93463ebe79a9b1402 [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 ],
18 deps = [
19 "//aos:init",
20 "//aos:once",
21 "//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",
28 ],
Brian Silverman100534c2015-09-07 15:51:23 -040029)
Tyler Chatowa79419d2020-08-12 20:12:11 -070030
31cc_library(
32 name = "starterd_lib",
33 srcs = ["starterd_lib.cc"],
34 hdrs = ["starterd_lib.h"],
35 deps = [
36 ":starter_fbs",
37 ":starter_rpc_fbs",
38 "//aos:configuration",
39 "//aos:macros",
40 "//aos/events:shm_event_loop",
41 "@com_github_google_glog//:glog",
42 ],
43)
44
45cc_test(
46 name = "starter_test",
47 srcs = ["starter_test.cc"],
48 data = [
49 "//aos/events:ping",
50 "//aos/events:pingpong_config",
51 "//aos/events:pong",
52 ],
53 deps = [
54 ":starter_rpc_lib",
55 ":starterd_lib",
56 "//aos/events:ping_fbs",
57 "//aos/events:pong_fbs",
58 "//aos/testing:googletest",
59 "//aos/testing:tmpdir",
60 ],
61)
62
63cc_binary(
64 name = "starterd",
65 srcs = ["starterd.cc"],
66 deps = [
67 ":starterd_lib",
68 "//aos:init",
69 ],
70)
71
72cc_library(
73 name = "starter_rpc_lib",
74 srcs = ["starter_rpc_lib.cc"],
75 hdrs = ["starter_rpc_lib.h"],
76 deps = [
77 ":starter_fbs",
78 ":starter_rpc_fbs",
79 "//aos:configuration",
80 "//aos:init",
81 "//aos/events:shm_event_loop",
82 ],
83)
84
85cc_binary(
86 name = "starter_cmd",
87 srcs = ["starter_cmd.cc"],
88 deps = [
89 ":starter_rpc_lib",
90 "@com_github_google_glog//:glog",
91 ],
92)
93
94flatbuffer_cc_library(
95 name = "starter_fbs",
96 srcs = ["starter.fbs"],
97 gen_reflections = True,
98 visibility = ["//visibility:public"],
99)
100
101flatbuffer_cc_library(
102 name = "starter_rpc_fbs",
103 srcs = ["starter_rpc.fbs"],
104 gen_reflections = True,
105 visibility = ["//visibility:public"],
106)