Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 1 | load("//aos/seasocks:gen_embedded.bzl", "gen_embedded") |
| 2 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_ts_library") |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 3 | load("//aos:config.bzl", "aos_config") |
| 4 | |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 5 | package(default_visibility = ["//visibility:public"]) |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 6 | |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 7 | flatbuffer_cc_library( |
| 8 | name = "connect_fbs", |
| 9 | srcs = ["connect.fbs"], |
| 10 | gen_reflections = 1, |
| 11 | includes = [ |
| 12 | "//aos:configuration_fbs_includes", |
| 13 | ], |
| 14 | ) |
| 15 | |
| 16 | flatbuffer_cc_library( |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame^] | 17 | name = "timestamp_fbs", |
| 18 | srcs = ["timestamp.fbs"], |
| 19 | gen_reflections = 1, |
| 20 | includes = [ |
| 21 | "//aos:configuration_fbs_includes", |
| 22 | ], |
| 23 | ) |
| 24 | |
| 25 | flatbuffer_cc_library( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 26 | name = "message_bridge_client_fbs", |
| 27 | srcs = ["message_bridge_client.fbs"], |
| 28 | gen_reflections = 1, |
| 29 | includes = [ |
| 30 | ":message_bridge_server_fbs_includes", |
| 31 | "//aos:configuration_fbs_includes", |
| 32 | ], |
| 33 | ) |
| 34 | |
| 35 | flatbuffer_cc_library( |
| 36 | name = "message_bridge_server_fbs", |
| 37 | srcs = ["message_bridge_server.fbs"], |
| 38 | gen_reflections = 1, |
| 39 | includes = [ |
| 40 | "//aos:configuration_fbs_includes", |
| 41 | ], |
| 42 | ) |
| 43 | |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 44 | cc_library( |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 45 | name = "team_number", |
| 46 | srcs = [ |
| 47 | "team_number.cc", |
| 48 | ], |
| 49 | hdrs = [ |
| 50 | "team_number.h", |
| 51 | ], |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 52 | deps = [ |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 53 | "//aos/logging", |
| 54 | "//aos/util:string_to_num", |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 55 | "@com_google_absl//absl/base", |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 56 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 57 | ) |
| 58 | |
Austin Schuh | df5591e | 2015-12-19 22:36:50 -0800 | [diff] [blame] | 59 | cc_test( |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 60 | name = "team_number_test", |
| 61 | srcs = [ |
| 62 | "team_number_test.cc", |
| 63 | ], |
| 64 | deps = [ |
| 65 | ":team_number", |
| 66 | "//aos/testing:googletest", |
| 67 | ], |
Austin Schuh | df5591e | 2015-12-19 22:36:50 -0800 | [diff] [blame] | 68 | ) |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 69 | |
| 70 | cc_library( |
| 71 | name = "sctp_lib", |
| 72 | srcs = [ |
| 73 | "sctp_lib.cc", |
| 74 | ], |
| 75 | hdrs = [ |
| 76 | "sctp_lib.h", |
| 77 | ], |
| 78 | copts = [ |
| 79 | # The casts required to read datastructures from sockets trip -Wcast-align. |
| 80 | "-Wno-cast-align", |
| 81 | ], |
| 82 | deps = [ |
| 83 | "//aos:unique_malloc_ptr", |
| 84 | "//third_party/lksctp-tools:sctp", |
| 85 | "@com_github_google_glog//:glog", |
| 86 | ], |
| 87 | ) |
| 88 | |
| 89 | cc_library( |
| 90 | name = "sctp_server", |
| 91 | srcs = [ |
| 92 | "sctp_server.cc", |
| 93 | ], |
| 94 | hdrs = [ |
| 95 | "sctp_server.h", |
| 96 | ], |
| 97 | copts = [ |
| 98 | "-Wno-cast-align", |
| 99 | ], |
| 100 | deps = [ |
| 101 | ":sctp_lib", |
| 102 | "//third_party/lksctp-tools:sctp", |
| 103 | ], |
| 104 | ) |
| 105 | |
| 106 | cc_library( |
| 107 | name = "message_bridge_protocol", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame^] | 108 | srcs = [ |
| 109 | "message_bridge_protocol.cc", |
| 110 | ], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 111 | hdrs = [ |
| 112 | "message_bridge_protocol.h", |
| 113 | ], |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame^] | 114 | deps = [ |
| 115 | ":connect_fbs", |
| 116 | "//aos:configuration", |
| 117 | "//aos:flatbuffer_merge", |
| 118 | "//aos:flatbuffers", |
| 119 | "@com_github_google_flatbuffers//:flatbuffers", |
| 120 | ], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 121 | ) |
| 122 | |
| 123 | cc_library( |
| 124 | name = "message_bridge_server_lib", |
| 125 | srcs = [ |
| 126 | "message_bridge_server_lib.cc", |
| 127 | ], |
| 128 | hdrs = [ |
| 129 | "message_bridge_server_lib.h", |
| 130 | ], |
| 131 | copts = [ |
| 132 | "-Wno-cast-align", |
| 133 | ], |
| 134 | deps = [ |
| 135 | ":connect_fbs", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame^] | 136 | ":message_bridge_client_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 137 | ":message_bridge_protocol", |
| 138 | ":message_bridge_server_fbs", |
| 139 | ":sctp_lib", |
| 140 | ":sctp_server", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame^] | 141 | ":timestamp_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 142 | "//aos:unique_malloc_ptr", |
| 143 | "//aos/events:shm_event_loop", |
| 144 | "//aos/events/logging:logger", |
| 145 | "//third_party/lksctp-tools:sctp", |
| 146 | ], |
| 147 | ) |
| 148 | |
| 149 | cc_binary( |
| 150 | name = "message_bridge_server", |
| 151 | srcs = [ |
| 152 | "message_bridge_server.cc", |
| 153 | ], |
| 154 | deps = [ |
| 155 | ":message_bridge_server_lib", |
| 156 | "//aos:init", |
| 157 | "//aos:json_to_flatbuffer", |
| 158 | "//aos/events:shm_event_loop", |
| 159 | ], |
| 160 | ) |
| 161 | |
| 162 | cc_library( |
| 163 | name = "sctp_client", |
| 164 | srcs = [ |
| 165 | "sctp_client.cc", |
| 166 | ], |
| 167 | hdrs = [ |
| 168 | "sctp_client.h", |
| 169 | ], |
| 170 | copts = [ |
| 171 | "-Wno-cast-align", |
| 172 | ], |
| 173 | deps = [ |
| 174 | ":sctp_lib", |
| 175 | "//third_party/lksctp-tools:sctp", |
| 176 | ], |
| 177 | ) |
| 178 | |
| 179 | cc_library( |
| 180 | name = "message_bridge_client_lib", |
| 181 | srcs = [ |
| 182 | "message_bridge_client_lib.cc", |
| 183 | ], |
| 184 | hdrs = [ |
| 185 | "message_bridge_client_lib.h", |
| 186 | ], |
| 187 | copts = [ |
| 188 | "-Wno-cast-align", |
| 189 | ], |
| 190 | deps = [ |
| 191 | ":connect_fbs", |
| 192 | ":message_bridge_client_fbs", |
| 193 | ":message_bridge_protocol", |
| 194 | ":message_bridge_server_fbs", |
| 195 | ":sctp_client", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame^] | 196 | ":timestamp_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 197 | "//aos/events:shm_event_loop", |
| 198 | "//aos/events/logging:logger", |
| 199 | ], |
| 200 | ) |
| 201 | |
| 202 | cc_binary( |
| 203 | name = "message_bridge_client", |
| 204 | srcs = [ |
| 205 | "message_bridge_client.cc", |
| 206 | ], |
| 207 | copts = [ |
| 208 | "-Wno-cast-align", |
| 209 | ], |
| 210 | deps = [ |
| 211 | ":message_bridge_client_lib", |
| 212 | "//aos:init", |
| 213 | "//aos:json_to_flatbuffer", |
| 214 | "//aos/events:shm_event_loop", |
| 215 | ], |
| 216 | ) |
| 217 | |
| 218 | aos_config( |
| 219 | name = "message_bridge_test_common_config", |
| 220 | src = "message_bridge_test_common.json", |
| 221 | flatbuffers = [ |
| 222 | "//aos/events:ping_fbs", |
| 223 | "//aos/events:pong_fbs", |
| 224 | "//aos/network:message_bridge_client_fbs", |
| 225 | "//aos/network:message_bridge_server_fbs", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame^] | 226 | "//aos/network:timestamp_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 227 | ], |
| 228 | deps = ["//aos/events:config"], |
| 229 | ) |
| 230 | |
| 231 | aos_config( |
| 232 | name = "message_bridge_test_server_config", |
| 233 | src = "message_bridge_test_server.json", |
| 234 | deps = [":message_bridge_test_common_config"], |
| 235 | ) |
| 236 | |
| 237 | aos_config( |
| 238 | name = "message_bridge_test_client_config", |
| 239 | src = "message_bridge_test_client.json", |
| 240 | deps = [":message_bridge_test_common_config"], |
| 241 | ) |
| 242 | |
| 243 | cc_test( |
| 244 | name = "message_bridge_test", |
| 245 | srcs = [ |
| 246 | "message_bridge_test.cc", |
| 247 | ], |
| 248 | data = [ |
| 249 | ":message_bridge_test_client_config.json", |
| 250 | ":message_bridge_test_server_config.json", |
| 251 | ], |
| 252 | deps = [ |
| 253 | ":message_bridge_client_lib", |
| 254 | ":message_bridge_server_lib", |
| 255 | "//aos:json_to_flatbuffer", |
| 256 | "//aos/events:ping_fbs", |
| 257 | "//aos/events:pong_fbs", |
| 258 | "//aos/events:shm_event_loop", |
| 259 | "//aos/testing:googletest", |
| 260 | ], |
| 261 | ) |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 262 | |
| 263 | flatbuffer_cc_library( |
| 264 | name = "web_proxy_fbs", |
| 265 | srcs = ["web_proxy.fbs"], |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame^] | 266 | gen_reflections = True, |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 267 | includes = [ |
| 268 | ":connect_fbs_includes", |
| 269 | "//aos:configuration_fbs_includes", |
| 270 | ], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 271 | ) |
| 272 | |
| 273 | flatbuffer_ts_library( |
| 274 | name = "web_proxy_ts_fbs", |
| 275 | srcs = ["web_proxy.fbs"], |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 276 | includes = [ |
| 277 | ":connect_fbs_includes", |
| 278 | "//aos:configuration_fbs_includes", |
| 279 | ], |
| 280 | ) |
| 281 | |
| 282 | cc_library( |
| 283 | name = "web_proxy_utils", |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 284 | srcs = ["web_proxy_utils.cc"], |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame^] | 285 | hdrs = ["web_proxy_utils.h"], |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 286 | deps = [ |
| 287 | ":connect_fbs", |
| 288 | ":web_proxy_fbs", |
| 289 | "//aos:configuration_fbs", |
| 290 | "//aos/events:event_loop", |
| 291 | "@com_github_google_flatbuffers//:flatbuffers", |
| 292 | ], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 293 | ) |
| 294 | |
| 295 | cc_library( |
| 296 | name = "web_proxy", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 297 | srcs = ["web_proxy.cc"], |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 298 | hdrs = ["web_proxy.h"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 299 | copts = [ |
| 300 | "-DWEBRTC_POSIX", |
| 301 | "-Wno-unused-parameter", |
| 302 | ], |
| 303 | deps = [ |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 304 | ":connect_fbs", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 305 | ":web_proxy_fbs", |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 306 | ":web_proxy_utils", |
| 307 | "//aos/events:shm_event_loop", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 308 | "//aos/seasocks:seasocks_logger", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 309 | "//third_party:webrtc", |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 310 | "//third_party/seasocks", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 311 | "@com_github_google_glog//:glog", |
| 312 | ], |
| 313 | ) |
| 314 | |
| 315 | gen_embedded( |
| 316 | name = "gen_embedded", |
| 317 | srcs = glob( |
| 318 | include = ["www_defaults/**/*"], |
| 319 | exclude = ["www/**/*"], |
| 320 | ), |
| 321 | ) |
| 322 | |
| 323 | cc_binary( |
| 324 | name = "web_proxy_main", |
| 325 | srcs = ["web_proxy_main.cc"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 326 | copts = [ |
| 327 | "-DWEBRTC_POSIX", |
| 328 | "-Wno-unused-parameter", |
| 329 | ], |
| 330 | data = [ |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 331 | "//aos/events:pingpong_config.json", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame^] | 332 | "//aos/network/www:files", |
| 333 | "//aos/network/www:flatbuffers", |
| 334 | "//aos/network/www:main_bundle", |
| 335 | "@com_github_google_flatbuffers//:flatjs", |
| 336 | ], |
| 337 | deps = [ |
| 338 | ":gen_embedded", |
| 339 | ":web_proxy", |
| 340 | "//aos:init", |
| 341 | "//aos/events:shm_event_loop", |
| 342 | "//aos/seasocks:seasocks_logger", |
| 343 | "//third_party/seasocks", |
| 344 | "@com_github_google_flatbuffers//:flatbuffers", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 345 | ], |
| 346 | ) |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 347 | |
| 348 | cc_library( |
| 349 | name = "timestamp_filter", |
| 350 | hdrs = ["timestamp_filter.h"], |
| 351 | deps = [ |
| 352 | "//aos/time", |
| 353 | ], |
| 354 | ) |
| 355 | |
| 356 | cc_test( |
| 357 | name = "timestamp_filter_test", |
| 358 | srcs = [ |
| 359 | "timestamp_filter_test.cc", |
| 360 | ], |
| 361 | deps = [ |
| 362 | ":timestamp_filter", |
| 363 | "//aos/testing:googletest", |
| 364 | ], |
| 365 | ) |