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