blob: 975971372bf9a4fdf4de74f73b8f0557cb075edf [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",
Austin Schuh373f1762021-06-02 21:07:09 -070044 "//aos/testing:path",
Tyler Chatowa79419d2020-08-12 20:12:11 -070045 "//aos/testing:tmpdir",
46 ],
47)
48
49cc_binary(
50 name = "starterd",
51 srcs = ["starterd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080052 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070053 deps = [
54 ":starterd_lib",
55 "//aos:init",
56 ],
57)
58
59cc_library(
60 name = "starter_rpc_lib",
61 srcs = ["starter_rpc_lib.cc"],
62 hdrs = ["starter_rpc_lib.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080063 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070064 deps = [
65 ":starter_fbs",
66 ":starter_rpc_fbs",
67 "//aos:configuration",
68 "//aos:init",
69 "//aos/events:shm_event_loop",
70 ],
71)
72
73cc_binary(
74 name = "starter_cmd",
75 srcs = ["starter_cmd.cc"],
Philipp Schraderdada1072020-11-24 11:34:46 -080076 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070077 deps = [
78 ":starter_rpc_lib",
Austin Schuhc61e9c02021-04-26 12:10:40 -070079 "//aos/time",
Tyler Chatowa79419d2020-08-12 20:12:11 -070080 "@com_github_google_glog//:glog",
Philipp Schrader08537492021-01-23 16:17:55 -080081 "@com_google_absl//absl/strings:str_format",
Tyler Chatowa79419d2020-08-12 20:12:11 -070082 ],
83)
84
85flatbuffer_cc_library(
86 name = "starter_fbs",
87 srcs = ["starter.fbs"],
88 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -080089 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070090 visibility = ["//visibility:public"],
91)
92
93flatbuffer_cc_library(
94 name = "starter_rpc_fbs",
95 srcs = ["starter_rpc.fbs"],
96 gen_reflections = True,
Philipp Schraderdada1072020-11-24 11:34:46 -080097 target_compatible_with = ["@platforms//os:linux"],
Tyler Chatowa79419d2020-08-12 20:12:11 -070098 visibility = ["//visibility:public"],
99)