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