Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 1 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 2 | load("//aos:config.bzl", "aos_config") |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 3 | |
| 4 | package(default_visibility = ["//visibility:public"]) |
| 5 | |
| 6 | flatbuffer_cc_library( |
| 7 | name = "test_message_fbs", |
| 8 | srcs = ["test_message.fbs"], |
| 9 | gen_reflections = 1, |
| 10 | ) |
| 11 | |
| 12 | flatbuffer_cc_library( |
Austin Schuh | e410614 | 2019-12-01 18:19:53 -0800 | [diff] [blame] | 13 | name = "event_loop_fbs", |
| 14 | srcs = ["event_loop.fbs"], |
| 15 | gen_reflections = 1, |
| 16 | includes = [ |
| 17 | "//aos:configuration_fbs_includes", |
| 18 | ], |
| 19 | ) |
| 20 | |
| 21 | flatbuffer_cc_library( |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 22 | name = "ping_fbs", |
| 23 | srcs = ["ping.fbs"], |
| 24 | gen_reflections = 1, |
| 25 | ) |
| 26 | |
| 27 | flatbuffer_cc_library( |
| 28 | name = "pong_fbs", |
| 29 | srcs = ["pong.fbs"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 30 | gen_reflections = 1, |
| 31 | ) |
| 32 | |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 33 | cc_library( |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 34 | name = "epoll", |
| 35 | srcs = ["epoll.cc"], |
| 36 | hdrs = ["epoll.h"], |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 37 | visibility = ["//visibility:public"], |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 38 | deps = [ |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 39 | "//aos/time", |
Austin Schuh | f257f3c | 2019-10-27 21:00:43 -0700 | [diff] [blame] | 40 | "@com_github_google_glog//:glog", |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 41 | ], |
| 42 | ) |
| 43 | |
Brian Silverman | 441591b | 2020-01-31 17:44:32 -0800 | [diff] [blame^] | 44 | cc_test( |
| 45 | name = "epoll_test", |
| 46 | srcs = ["epoll_test.cc"], |
| 47 | deps = [ |
| 48 | ":epoll", |
| 49 | "//aos/testing:googletest", |
| 50 | "@com_github_google_glog//:glog", |
| 51 | ], |
| 52 | ) |
| 53 | |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 54 | cc_library( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 55 | name = "event_loop", |
Austin Schuh | 54cf95f | 2019-11-29 13:14:18 -0800 | [diff] [blame] | 56 | srcs = [ |
| 57 | "event_loop.cc", |
Austin Schuh | 7d87b67 | 2019-12-01 20:23:49 -0800 | [diff] [blame] | 58 | "event_loop_event.h", |
Austin Schuh | 54cf95f | 2019-11-29 13:14:18 -0800 | [diff] [blame] | 59 | "event_loop_tmpl.h", |
| 60 | ], |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 61 | hdrs = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 62 | "event_loop.h", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 63 | ], |
| 64 | visibility = ["//visibility:public"], |
| 65 | deps = [ |
Austin Schuh | 39788ff | 2019-12-01 18:22:57 -0800 | [diff] [blame] | 66 | ":event_loop_fbs", |
| 67 | ":timing_statistics", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 68 | "//aos:configuration", |
| 69 | "//aos:configuration_fbs", |
| 70 | "//aos:flatbuffers", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 71 | "//aos/time", |
Austin Schuh | 39788ff | 2019-12-01 18:22:57 -0800 | [diff] [blame] | 72 | "//aos/util:phased_loop", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 73 | "@com_github_google_flatbuffers//:flatbuffers", |
Brian Silverman | 0fc6993 | 2020-01-24 21:54:02 -0800 | [diff] [blame] | 74 | "@com_google_absl//absl/container:btree", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 75 | ], |
| 76 | ) |
| 77 | |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 78 | cc_library( |
| 79 | name = "ping_lib", |
| 80 | srcs = [ |
| 81 | "ping_lib.cc", |
| 82 | ], |
| 83 | hdrs = [ |
| 84 | "ping_lib.h", |
| 85 | ], |
| 86 | deps = [ |
| 87 | ":event_loop", |
| 88 | ":ping_fbs", |
| 89 | ":pong_fbs", |
| 90 | "//aos:json_to_flatbuffer", |
| 91 | "@com_github_google_glog//:glog", |
| 92 | ], |
| 93 | ) |
| 94 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 95 | cc_binary( |
| 96 | name = "ping", |
| 97 | srcs = [ |
| 98 | "ping.cc", |
| 99 | ], |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 100 | data = ["pingpong_config.json"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 101 | deps = [ |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 102 | ":ping_lib", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 103 | ":shm_event_loop", |
| 104 | "//aos:configuration", |
| 105 | "//aos:init", |
| 106 | "//aos:json_to_flatbuffer", |
| 107 | "@com_github_google_glog//:glog", |
| 108 | ], |
| 109 | ) |
| 110 | |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 111 | aos_config( |
Austin Schuh | 39788ff | 2019-12-01 18:22:57 -0800 | [diff] [blame] | 112 | name = "config", |
| 113 | src = "aos.json", |
| 114 | flatbuffers = [ |
| 115 | ":event_loop_fbs", |
| 116 | ], |
| 117 | ) |
| 118 | |
| 119 | aos_config( |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 120 | name = "pingpong_config", |
Austin Schuh | 39788ff | 2019-12-01 18:22:57 -0800 | [diff] [blame] | 121 | src = "pingpong.json", |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 122 | flatbuffers = [ |
| 123 | ":ping_fbs", |
| 124 | ":pong_fbs", |
| 125 | ], |
Austin Schuh | 39788ff | 2019-12-01 18:22:57 -0800 | [diff] [blame] | 126 | deps = [":config"], |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 127 | ) |
| 128 | |
Austin Schuh | 15649d6 | 2019-12-28 16:36:38 -0800 | [diff] [blame] | 129 | aos_config( |
| 130 | name = "multinode_pingpong_config", |
| 131 | src = "multinode_pingpong.json", |
| 132 | flatbuffers = [ |
| 133 | ":ping_fbs", |
| 134 | ":pong_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 135 | "//aos/network:message_bridge_client_fbs", |
| 136 | "//aos/network:message_bridge_server_fbs", |
Austin Schuh | 15649d6 | 2019-12-28 16:36:38 -0800 | [diff] [blame] | 137 | ], |
| 138 | deps = [":config"], |
| 139 | ) |
| 140 | |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 141 | cc_library( |
| 142 | name = "pong_lib", |
| 143 | srcs = [ |
| 144 | "pong_lib.cc", |
| 145 | ], |
| 146 | hdrs = [ |
| 147 | "pong_lib.h", |
| 148 | ], |
| 149 | deps = [ |
| 150 | ":event_loop", |
| 151 | ":ping_fbs", |
| 152 | ":pong_fbs", |
| 153 | "@com_github_google_glog//:glog", |
| 154 | ], |
| 155 | ) |
| 156 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 157 | cc_binary( |
| 158 | name = "pong", |
| 159 | srcs = [ |
| 160 | "pong.cc", |
| 161 | ], |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 162 | data = ["pingpong_config.json"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 163 | deps = [ |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 164 | ":ping_fbs", |
| 165 | ":pong_fbs", |
| 166 | ":pong_lib", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 167 | ":shm_event_loop", |
| 168 | "//aos:configuration", |
| 169 | "//aos:init", |
| 170 | "//aos:json_to_flatbuffer", |
| 171 | "@com_github_google_glog//:glog", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 172 | ], |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 173 | ) |
| 174 | |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 175 | cc_test( |
| 176 | name = "pingpong_test", |
| 177 | srcs = ["pingpong_test.cc"], |
| 178 | data = [":pingpong_config.json"], |
| 179 | deps = [ |
| 180 | ":ping_lib", |
| 181 | ":pong_lib", |
| 182 | ":simulated_event_loop", |
| 183 | "//aos:configuration", |
| 184 | "//aos:flatbuffers", |
| 185 | "//aos/testing:googletest", |
| 186 | ], |
| 187 | ) |
| 188 | |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 189 | cc_library( |
Austin Schuh | e410614 | 2019-12-01 18:19:53 -0800 | [diff] [blame] | 190 | name = "timing_statistics", |
| 191 | srcs = ["timing_statistics.cc"], |
| 192 | hdrs = ["timing_statistics.h"], |
| 193 | deps = [ |
| 194 | ":event_loop_fbs", |
| 195 | "//aos:configuration", |
| 196 | "@com_github_google_glog//:glog", |
| 197 | ], |
| 198 | ) |
| 199 | |
| 200 | cc_test( |
| 201 | name = "timing_statistics_test", |
| 202 | srcs = ["timing_statistics_test.cc"], |
| 203 | deps = [ |
| 204 | ":timing_statistics", |
| 205 | "//aos:configuration", |
| 206 | "//aos:flatbuffers", |
| 207 | "//aos/testing:googletest", |
| 208 | ], |
| 209 | ) |
| 210 | |
| 211 | cc_library( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 212 | name = "shm_event_loop", |
| 213 | srcs = ["shm_event_loop.cc"], |
| 214 | hdrs = ["shm_event_loop.h"], |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 215 | visibility = ["//visibility:public"], |
| 216 | deps = [ |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 217 | ":epoll", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 218 | ":event_loop", |
Austin Schuh | 39788ff | 2019-12-01 18:22:57 -0800 | [diff] [blame] | 219 | ":event_loop_fbs", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 220 | ":test_message_fbs", |
Austin Schuh | 39788ff | 2019-12-01 18:22:57 -0800 | [diff] [blame] | 221 | ":timing_statistics", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 222 | "//aos:realtime", |
| 223 | "//aos/ipc_lib:lockless_queue", |
| 224 | "//aos/ipc_lib:signalfd", |
Austin Schuh | 32fd5a7 | 2019-12-01 22:20:26 -0800 | [diff] [blame] | 225 | "//aos/stl_mutex", |
Austin Schuh | 52d325c | 2019-06-23 18:59:06 -0700 | [diff] [blame] | 226 | "//aos/util:phased_loop", |
Brian Silverman | 441591b | 2020-01-31 17:44:32 -0800 | [diff] [blame^] | 227 | "@com_google_absl//absl/base", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 228 | ], |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 229 | ) |
| 230 | |
| 231 | cc_test( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 232 | name = "shm_event_loop_test", |
| 233 | srcs = ["shm_event_loop_test.cc"], |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 234 | shard_count = 5, |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 235 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 236 | ":event_loop_param_test", |
| 237 | ":shm_event_loop", |
| 238 | ":test_message_fbs", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 239 | ], |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 240 | ) |
| 241 | |
| 242 | cc_library( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 243 | name = "event_loop_param_test", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 244 | testonly = True, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 245 | srcs = ["event_loop_param_test.cc"], |
| 246 | hdrs = ["event_loop_param_test.h"], |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 247 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 248 | ":event_loop", |
| 249 | ":test_message_fbs", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 250 | "//aos/testing:googletest", |
| 251 | ], |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 252 | ) |
Neil Balch | c8f41ed | 2018-01-20 22:06:53 -0800 | [diff] [blame] | 253 | |
| 254 | cc_test( |
Austin Schuh | 7267c53 | 2019-05-19 19:55:53 -0700 | [diff] [blame] | 255 | name = "simulated_event_loop_test", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 256 | srcs = ["simulated_event_loop_test.cc"], |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 257 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 258 | ":event_loop_param_test", |
Austin Schuh | 7267c53 | 2019-05-19 19:55:53 -0700 | [diff] [blame] | 259 | ":simulated_event_loop", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 260 | "//aos/testing:googletest", |
| 261 | ], |
Neil Balch | c8f41ed | 2018-01-20 22:06:53 -0800 | [diff] [blame] | 262 | ) |
| 263 | |
| 264 | cc_library( |
Austin Schuh | e1dafe4 | 2020-01-06 21:12:03 -0800 | [diff] [blame] | 265 | name = "simple_channel", |
| 266 | srcs = ["simple_channel.cc"], |
| 267 | hdrs = ["simple_channel.h"], |
| 268 | deps = [ |
| 269 | "//aos:configuration_fbs", |
| 270 | "@com_github_google_flatbuffers//:flatbuffers", |
| 271 | "@com_github_google_glog//:glog", |
| 272 | "@com_google_absl//absl/strings", |
| 273 | ], |
| 274 | ) |
| 275 | |
| 276 | cc_library( |
Austin Schuh | 7267c53 | 2019-05-19 19:55:53 -0700 | [diff] [blame] | 277 | name = "simulated_event_loop", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 278 | srcs = [ |
| 279 | "event_scheduler.cc", |
| 280 | "simulated_event_loop.cc", |
| 281 | ], |
| 282 | hdrs = [ |
| 283 | "event_scheduler.h", |
| 284 | "simulated_event_loop.h", |
| 285 | ], |
Austin Schuh | 7267c53 | 2019-05-19 19:55:53 -0700 | [diff] [blame] | 286 | visibility = ["//visibility:public"], |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 287 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 288 | ":event_loop", |
Austin Schuh | e1dafe4 | 2020-01-06 21:12:03 -0800 | [diff] [blame] | 289 | ":simple_channel", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 290 | "//aos/ipc_lib:index", |
Austin Schuh | 52d325c | 2019-06-23 18:59:06 -0700 | [diff] [blame] | 291 | "//aos/util:phased_loop", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 292 | "@com_google_absl//absl/container:btree", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 293 | ], |
Neil Balch | c8f41ed | 2018-01-20 22:06:53 -0800 | [diff] [blame] | 294 | ) |