Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 1 | load("//aos/seasocks:gen_embedded.bzl", "gen_embedded") |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 2 | load("//aos:config.bzl", "aos_config") |
Austin Schuh | 0de30f3 | 2020-12-06 12:44:28 -0800 | [diff] [blame] | 3 | load("//aos:flatbuffers.bzl", "cc_static_flatbuffer") |
| 4 | 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] | 5 | |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 6 | package(default_visibility = ["//visibility:public"]) |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 7 | |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 8 | flatbuffer_cc_library( |
Austin Schuh | 0de30f3 | 2020-12-06 12:44:28 -0800 | [diff] [blame] | 9 | name = "remote_message_fbs", |
| 10 | srcs = ["remote_message.fbs"], |
| 11 | gen_reflections = 1, |
| 12 | ) |
| 13 | |
| 14 | cc_static_flatbuffer( |
| 15 | name = "remote_message_schema", |
| 16 | function = "aos::message_bridge::RemoteMessageSchema", |
| 17 | target = ":remote_message_fbs_reflection_out", |
| 18 | ) |
| 19 | |
| 20 | flatbuffer_cc_library( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 21 | name = "connect_fbs", |
| 22 | srcs = ["connect.fbs"], |
| 23 | gen_reflections = 1, |
| 24 | includes = [ |
| 25 | "//aos:configuration_fbs_includes", |
| 26 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 27 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 28 | ) |
| 29 | |
Alex Perry | d5e1357 | 2020-02-22 15:15:08 -0800 | [diff] [blame] | 30 | flatbuffer_ts_library( |
| 31 | name = "connect_ts_fbs", |
| 32 | srcs = ["connect.fbs"], |
| 33 | includes = [ |
| 34 | "//aos:configuration_fbs_includes", |
| 35 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 36 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | d5e1357 | 2020-02-22 15:15:08 -0800 | [diff] [blame] | 37 | ) |
| 38 | |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 39 | flatbuffer_cc_library( |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 40 | name = "timestamp_fbs", |
| 41 | srcs = ["timestamp.fbs"], |
| 42 | gen_reflections = 1, |
| 43 | includes = [ |
| 44 | "//aos:configuration_fbs_includes", |
| 45 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 46 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 47 | ) |
| 48 | |
| 49 | flatbuffer_cc_library( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 50 | name = "message_bridge_client_fbs", |
| 51 | srcs = ["message_bridge_client.fbs"], |
| 52 | gen_reflections = 1, |
| 53 | includes = [ |
| 54 | ":message_bridge_server_fbs_includes", |
| 55 | "//aos:configuration_fbs_includes", |
| 56 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 57 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 58 | ) |
| 59 | |
| 60 | flatbuffer_cc_library( |
| 61 | name = "message_bridge_server_fbs", |
| 62 | srcs = ["message_bridge_server.fbs"], |
| 63 | gen_reflections = 1, |
| 64 | includes = [ |
| 65 | "//aos:configuration_fbs_includes", |
| 66 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 67 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 68 | ) |
| 69 | |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 70 | cc_library( |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 71 | name = "team_number", |
| 72 | srcs = [ |
| 73 | "team_number.cc", |
| 74 | ], |
| 75 | hdrs = [ |
| 76 | "team_number.h", |
| 77 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 78 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 79 | deps = [ |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 80 | "//aos/util:string_to_num", |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 81 | "@com_github_google_glog//:glog", |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 82 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 83 | ) |
| 84 | |
Austin Schuh | df5591e | 2015-12-19 22:36:50 -0800 | [diff] [blame] | 85 | cc_test( |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 86 | name = "team_number_test", |
| 87 | srcs = [ |
| 88 | "team_number_test.cc", |
| 89 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 90 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 91 | deps = [ |
| 92 | ":team_number", |
Jim Ostrowski | 8565b40 | 2020-02-29 20:26:53 -0800 | [diff] [blame] | 93 | "//aos:configuration", |
Brian Silverman | 7a7c24d | 2018-09-01 17:49:09 -0700 | [diff] [blame] | 94 | "//aos/testing:googletest", |
| 95 | ], |
Austin Schuh | df5591e | 2015-12-19 22:36:50 -0800 | [diff] [blame] | 96 | ) |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 97 | |
| 98 | cc_library( |
| 99 | name = "sctp_lib", |
| 100 | srcs = [ |
| 101 | "sctp_lib.cc", |
| 102 | ], |
| 103 | hdrs = [ |
| 104 | "sctp_lib.h", |
| 105 | ], |
| 106 | copts = [ |
| 107 | # The casts required to read datastructures from sockets trip -Wcast-align. |
| 108 | "-Wno-cast-align", |
| 109 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 110 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 111 | deps = [ |
| 112 | "//aos:unique_malloc_ptr", |
Austin Schuh | 2fe4b71 | 2020-03-15 14:21:45 -0700 | [diff] [blame] | 113 | "//aos/util:file", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 114 | "//third_party/lksctp-tools:sctp", |
| 115 | "@com_github_google_glog//:glog", |
| 116 | ], |
| 117 | ) |
| 118 | |
| 119 | cc_library( |
| 120 | name = "sctp_server", |
| 121 | srcs = [ |
| 122 | "sctp_server.cc", |
| 123 | ], |
| 124 | hdrs = [ |
| 125 | "sctp_server.h", |
| 126 | ], |
| 127 | copts = [ |
| 128 | "-Wno-cast-align", |
| 129 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 130 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 131 | deps = [ |
| 132 | ":sctp_lib", |
| 133 | "//third_party/lksctp-tools:sctp", |
| 134 | ], |
| 135 | ) |
| 136 | |
| 137 | cc_library( |
| 138 | name = "message_bridge_protocol", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 139 | srcs = [ |
| 140 | "message_bridge_protocol.cc", |
| 141 | ], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 142 | hdrs = [ |
| 143 | "message_bridge_protocol.h", |
| 144 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 145 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 146 | deps = [ |
| 147 | ":connect_fbs", |
| 148 | "//aos:configuration", |
| 149 | "//aos:flatbuffer_merge", |
| 150 | "//aos:flatbuffers", |
| 151 | "@com_github_google_flatbuffers//:flatbuffers", |
| 152 | ], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 153 | ) |
| 154 | |
| 155 | cc_library( |
Austin Schuh | e19b675 | 2020-08-27 23:20:19 -0700 | [diff] [blame] | 156 | name = "message_bridge_server_status", |
| 157 | srcs = [ |
| 158 | "message_bridge_server_status.cc", |
| 159 | ], |
| 160 | hdrs = [ |
| 161 | "message_bridge_server_status.h", |
| 162 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 163 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e19b675 | 2020-08-27 23:20:19 -0700 | [diff] [blame] | 164 | deps = [ |
| 165 | ":message_bridge_client_fbs", |
| 166 | ":message_bridge_server_fbs", |
| 167 | ":timestamp_fbs", |
| 168 | ":timestamp_filter", |
| 169 | "//aos:flatbuffer_merge", |
| 170 | "//aos:flatbuffers", |
| 171 | "//aos/events:event_loop", |
| 172 | "//aos/time", |
| 173 | ], |
| 174 | ) |
| 175 | |
| 176 | cc_library( |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame^] | 177 | name = "timestamp_channel", |
| 178 | srcs = ["timestamp_channel.cc"], |
| 179 | hdrs = ["timestamp_channel.h"], |
| 180 | deps = [ |
| 181 | ":remote_message_fbs", |
| 182 | "//aos:configuration", |
| 183 | "//aos/events:event_loop", |
| 184 | "@com_github_google_glog//:glog", |
| 185 | "@com_google_absl//absl/container:btree", |
| 186 | "@com_google_absl//absl/strings", |
| 187 | ], |
| 188 | ) |
| 189 | |
| 190 | cc_library( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 191 | name = "message_bridge_server_lib", |
| 192 | srcs = [ |
| 193 | "message_bridge_server_lib.cc", |
| 194 | ], |
| 195 | hdrs = [ |
| 196 | "message_bridge_server_lib.h", |
| 197 | ], |
| 198 | copts = [ |
| 199 | "-Wno-cast-align", |
| 200 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 201 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 202 | deps = [ |
| 203 | ":connect_fbs", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 204 | ":message_bridge_client_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 205 | ":message_bridge_protocol", |
| 206 | ":message_bridge_server_fbs", |
Austin Schuh | e19b675 | 2020-08-27 23:20:19 -0700 | [diff] [blame] | 207 | ":message_bridge_server_status", |
Austin Schuh | 0de30f3 | 2020-12-06 12:44:28 -0800 | [diff] [blame] | 208 | ":remote_message_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 209 | ":sctp_lib", |
| 210 | ":sctp_server", |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame^] | 211 | ":timestamp_channel", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 212 | ":timestamp_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 213 | "//aos:unique_malloc_ptr", |
| 214 | "//aos/events:shm_event_loop", |
Austin Schuh | b06f03b | 2021-02-17 22:00:37 -0800 | [diff] [blame] | 215 | "//aos/events/logging:log_reader", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 216 | "//third_party/lksctp-tools:sctp", |
| 217 | ], |
| 218 | ) |
| 219 | |
| 220 | cc_binary( |
| 221 | name = "message_bridge_server", |
| 222 | srcs = [ |
| 223 | "message_bridge_server.cc", |
| 224 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 225 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 226 | deps = [ |
| 227 | ":message_bridge_server_lib", |
| 228 | "//aos:init", |
| 229 | "//aos:json_to_flatbuffer", |
| 230 | "//aos/events:shm_event_loop", |
| 231 | ], |
| 232 | ) |
| 233 | |
| 234 | cc_library( |
| 235 | name = "sctp_client", |
| 236 | srcs = [ |
| 237 | "sctp_client.cc", |
| 238 | ], |
| 239 | hdrs = [ |
| 240 | "sctp_client.h", |
| 241 | ], |
| 242 | copts = [ |
| 243 | "-Wno-cast-align", |
| 244 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 245 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 246 | deps = [ |
| 247 | ":sctp_lib", |
| 248 | "//third_party/lksctp-tools:sctp", |
| 249 | ], |
| 250 | ) |
| 251 | |
| 252 | cc_library( |
Austin Schuh | ae2e7bf | 2020-08-27 23:42:56 -0700 | [diff] [blame] | 253 | name = "message_bridge_client_status", |
| 254 | srcs = [ |
| 255 | "message_bridge_client_status.cc", |
| 256 | ], |
| 257 | hdrs = [ |
| 258 | "message_bridge_client_status.h", |
| 259 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 260 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | ae2e7bf | 2020-08-27 23:42:56 -0700 | [diff] [blame] | 261 | deps = [ |
| 262 | ":message_bridge_client_fbs", |
| 263 | ":message_bridge_server_fbs", |
| 264 | ":timestamp_filter", |
| 265 | "//aos:flatbuffers", |
| 266 | "//aos/events:event_loop", |
| 267 | "//aos/time", |
| 268 | ], |
| 269 | ) |
| 270 | |
| 271 | cc_library( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 272 | name = "message_bridge_client_lib", |
| 273 | srcs = [ |
| 274 | "message_bridge_client_lib.cc", |
| 275 | ], |
| 276 | hdrs = [ |
| 277 | "message_bridge_client_lib.h", |
| 278 | ], |
| 279 | copts = [ |
| 280 | "-Wno-cast-align", |
| 281 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 282 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 283 | deps = [ |
| 284 | ":connect_fbs", |
| 285 | ":message_bridge_client_fbs", |
Austin Schuh | ae2e7bf | 2020-08-27 23:42:56 -0700 | [diff] [blame] | 286 | ":message_bridge_client_status", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 287 | ":message_bridge_protocol", |
| 288 | ":message_bridge_server_fbs", |
Austin Schuh | 0de30f3 | 2020-12-06 12:44:28 -0800 | [diff] [blame] | 289 | ":remote_message_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 290 | ":sctp_client", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 291 | ":timestamp_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 292 | "//aos/events:shm_event_loop", |
Austin Schuh | b06f03b | 2021-02-17 22:00:37 -0800 | [diff] [blame] | 293 | "//aos/events/logging:log_reader", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 294 | ], |
| 295 | ) |
| 296 | |
| 297 | cc_binary( |
| 298 | name = "message_bridge_client", |
| 299 | srcs = [ |
| 300 | "message_bridge_client.cc", |
| 301 | ], |
| 302 | copts = [ |
| 303 | "-Wno-cast-align", |
| 304 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 305 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 306 | deps = [ |
| 307 | ":message_bridge_client_lib", |
| 308 | "//aos:init", |
| 309 | "//aos:json_to_flatbuffer", |
| 310 | "//aos/events:shm_event_loop", |
| 311 | ], |
| 312 | ) |
| 313 | |
| 314 | aos_config( |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame^] | 315 | name = "message_bridge_test_combined_timestamps_common_config", |
| 316 | src = "message_bridge_test_combined_timestamps_common.json", |
| 317 | flatbuffers = [ |
| 318 | ":remote_message_fbs", |
| 319 | "//aos/events:ping_fbs", |
| 320 | "//aos/events:pong_fbs", |
| 321 | "//aos/network:message_bridge_client_fbs", |
| 322 | "//aos/network:message_bridge_server_fbs", |
| 323 | "//aos/network:timestamp_fbs", |
| 324 | ], |
| 325 | target_compatible_with = ["@platforms//os:linux"], |
| 326 | deps = ["//aos/events:config"], |
| 327 | ) |
| 328 | |
| 329 | aos_config( |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 330 | name = "message_bridge_test_common_config", |
| 331 | src = "message_bridge_test_common.json", |
| 332 | flatbuffers = [ |
Austin Schuh | 0de30f3 | 2020-12-06 12:44:28 -0800 | [diff] [blame] | 333 | ":remote_message_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 334 | "//aos/events:ping_fbs", |
| 335 | "//aos/events:pong_fbs", |
| 336 | "//aos/network:message_bridge_client_fbs", |
| 337 | "//aos/network:message_bridge_server_fbs", |
Austin Schuh | 7bc5905 | 2020-02-16 23:48:33 -0800 | [diff] [blame] | 338 | "//aos/network:timestamp_fbs", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 339 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 340 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 341 | deps = ["//aos/events:config"], |
| 342 | ) |
| 343 | |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 344 | cc_test( |
| 345 | name = "message_bridge_test", |
| 346 | srcs = [ |
| 347 | "message_bridge_test.cc", |
| 348 | ], |
| 349 | data = [ |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame^] | 350 | ":message_bridge_test_combined_timestamps_common_config", |
Austin Schuh | f466ab5 | 2021-02-16 22:00:38 -0800 | [diff] [blame] | 351 | ":message_bridge_test_common_config", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 352 | ], |
Austin Schuh | 025ff51 | 2021-02-07 23:06:48 -0800 | [diff] [blame] | 353 | flaky = True, |
Austin Schuh | 36a2c3e | 2021-02-18 22:28:38 -0800 | [diff] [blame^] | 354 | shard_count = 10, |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 355 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 356 | deps = [ |
| 357 | ":message_bridge_client_lib", |
| 358 | ":message_bridge_server_lib", |
| 359 | "//aos:json_to_flatbuffer", |
| 360 | "//aos/events:ping_fbs", |
| 361 | "//aos/events:pong_fbs", |
| 362 | "//aos/events:shm_event_loop", |
Brian Silverman | 7b266d9 | 2021-02-17 21:24:02 -0800 | [diff] [blame] | 363 | "//aos/ipc_lib:event", |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 364 | "//aos/testing:googletest", |
| 365 | ], |
| 366 | ) |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 367 | |
| 368 | flatbuffer_cc_library( |
| 369 | name = "web_proxy_fbs", |
| 370 | srcs = ["web_proxy.fbs"], |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 371 | gen_reflections = True, |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 372 | includes = [ |
| 373 | ":connect_fbs_includes", |
| 374 | "//aos:configuration_fbs_includes", |
| 375 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 376 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 377 | ) |
| 378 | |
| 379 | flatbuffer_ts_library( |
| 380 | name = "web_proxy_ts_fbs", |
| 381 | srcs = ["web_proxy.fbs"], |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 382 | includes = [ |
| 383 | ":connect_fbs_includes", |
| 384 | "//aos:configuration_fbs_includes", |
| 385 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 386 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 387 | ) |
| 388 | |
| 389 | cc_library( |
| 390 | name = "web_proxy_utils", |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 391 | srcs = ["web_proxy_utils.cc"], |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 392 | hdrs = ["web_proxy_utils.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 393 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 394 | deps = [ |
| 395 | ":connect_fbs", |
| 396 | ":web_proxy_fbs", |
| 397 | "//aos:configuration_fbs", |
| 398 | "//aos/events:event_loop", |
| 399 | "@com_github_google_flatbuffers//:flatbuffers", |
| 400 | ], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 401 | ) |
| 402 | |
| 403 | cc_library( |
| 404 | name = "web_proxy", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 405 | srcs = ["web_proxy.cc"], |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 406 | hdrs = ["web_proxy.h"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 407 | copts = [ |
| 408 | "-DWEBRTC_POSIX", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 409 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 410 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 411 | deps = [ |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 412 | ":connect_fbs", |
James Kuszmaul | 4867136 | 2020-12-24 13:54:16 -0800 | [diff] [blame] | 413 | ":gen_embedded", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 414 | ":web_proxy_fbs", |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 415 | ":web_proxy_utils", |
| 416 | "//aos/events:shm_event_loop", |
James Kuszmaul | 8d928d0 | 2020-12-25 17:47:49 -0800 | [diff] [blame] | 417 | "//aos/mutex", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 418 | "//aos/seasocks:seasocks_logger", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 419 | "//third_party:webrtc", |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 420 | "//third_party/seasocks", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 421 | "@com_github_google_glog//:glog", |
| 422 | ], |
| 423 | ) |
| 424 | |
| 425 | gen_embedded( |
| 426 | name = "gen_embedded", |
| 427 | srcs = glob( |
| 428 | include = ["www_defaults/**/*"], |
| 429 | exclude = ["www/**/*"], |
| 430 | ), |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 431 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 432 | ) |
| 433 | |
| 434 | cc_binary( |
| 435 | name = "web_proxy_main", |
| 436 | srcs = ["web_proxy_main.cc"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 437 | copts = [ |
| 438 | "-DWEBRTC_POSIX", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 439 | ], |
| 440 | data = [ |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 441 | "//aos/network/www:files", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 442 | "//aos/network/www:main_bundle.min.js", |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 443 | "@com_github_google_flatbuffers//:flatjs", |
| 444 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 445 | target_compatible_with = ["@platforms//os:linux"], |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 446 | deps = [ |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 447 | ":web_proxy", |
| 448 | "//aos:init", |
| 449 | "//aos/events:shm_event_loop", |
Brian Silverman | 3dfbfb1 | 2020-02-17 20:35:18 -0800 | [diff] [blame] | 450 | "@com_github_google_flatbuffers//:flatbuffers", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 451 | ], |
| 452 | ) |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 453 | |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 454 | cc_binary( |
| 455 | name = "log_web_proxy_main", |
| 456 | srcs = ["log_web_proxy_main.cc"], |
| 457 | args = [ |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 458 | "--data_dir=aos/network/www", |
| 459 | ], |
| 460 | copts = [ |
| 461 | "-DWEBRTC_POSIX", |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 462 | ], |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 463 | deps = [ |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 464 | ":web_proxy", |
| 465 | "//aos:init", |
| 466 | "//aos/events:simulated_event_loop", |
Austin Schuh | b06f03b | 2021-02-17 22:00:37 -0800 | [diff] [blame] | 467 | "//aos/events/logging:log_reader", |
James Kuszmaul | 71a8193 | 2020-12-15 21:08:01 -0800 | [diff] [blame] | 468 | "@com_github_google_flatbuffers//:flatbuffers", |
| 469 | ], |
| 470 | ) |
| 471 | |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 472 | cc_library( |
| 473 | name = "timestamp_filter", |
Austin Schuh | 7ee6f72 | 2020-08-24 16:19:36 -0700 | [diff] [blame] | 474 | srcs = ["timestamp_filter.cc"], |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 475 | hdrs = ["timestamp_filter.h"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 476 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 477 | deps = [ |
Austin Schuh | 04eccfc | 2020-08-26 21:08:27 -0700 | [diff] [blame] | 478 | "//aos:configuration", |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 479 | "//aos/time", |
Austin Schuh | 85357ee | 2020-08-24 16:41:42 -0700 | [diff] [blame] | 480 | "@com_google_absl//absl/strings", |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 481 | ], |
| 482 | ) |
| 483 | |
Austin Schuh | 0ca1fd3 | 2020-12-18 22:53:05 -0800 | [diff] [blame] | 484 | cc_library( |
| 485 | name = "multinode_timestamp_filter", |
| 486 | srcs = ["multinode_timestamp_filter.cc"], |
| 487 | hdrs = ["multinode_timestamp_filter.h"], |
| 488 | target_compatible_with = ["@platforms//os:linux"], |
| 489 | deps = [ |
| 490 | ":timestamp_filter", |
| 491 | "//aos:configuration", |
| 492 | "//aos/events:simulated_event_loop", |
Austin Schuh | e639ea1 | 2021-01-25 13:00:22 -0800 | [diff] [blame] | 493 | "//aos/events/logging:logfile_utils", |
Austin Schuh | 0ca1fd3 | 2020-12-18 22:53:05 -0800 | [diff] [blame] | 494 | "//aos/time", |
Austin Schuh | 7466fe1 | 2020-12-29 23:01:47 -0800 | [diff] [blame] | 495 | "@com_github_stevengj_nlopt//:nlopt", |
Austin Schuh | 0ca1fd3 | 2020-12-18 22:53:05 -0800 | [diff] [blame] | 496 | "@org_tuxfamily_eigen//:eigen", |
| 497 | ], |
| 498 | ) |
| 499 | |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 500 | cc_test( |
| 501 | name = "timestamp_filter_test", |
| 502 | srcs = [ |
| 503 | "timestamp_filter_test.cc", |
| 504 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 505 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 506 | deps = [ |
| 507 | ":timestamp_filter", |
Austin Schuh | 04eccfc | 2020-08-26 21:08:27 -0700 | [diff] [blame] | 508 | "//aos:json_to_flatbuffer", |
Austin Schuh | 8bd9632 | 2020-02-13 21:18:22 -0800 | [diff] [blame] | 509 | "//aos/testing:googletest", |
| 510 | ], |
| 511 | ) |
Austin Schuh | 7466fe1 | 2020-12-29 23:01:47 -0800 | [diff] [blame] | 512 | |
Austin Schuh | a9abc03 | 2021-01-01 16:46:19 -0800 | [diff] [blame] | 513 | cc_library( |
| 514 | name = "testing_time_converter", |
| 515 | testonly = True, |
| 516 | srcs = ["testing_time_converter.cc"], |
| 517 | hdrs = ["testing_time_converter.h"], |
| 518 | deps = [ |
| 519 | ":multinode_timestamp_filter", |
| 520 | "//aos/events:simulated_event_loop", |
| 521 | "//aos/time", |
| 522 | ], |
| 523 | ) |
| 524 | |
Austin Schuh | 7466fe1 | 2020-12-29 23:01:47 -0800 | [diff] [blame] | 525 | cc_test( |
| 526 | name = "multinode_timestamp_filter_test", |
| 527 | srcs = [ |
| 528 | "multinode_timestamp_filter_test.cc", |
| 529 | ], |
| 530 | target_compatible_with = ["@platforms//os:linux"], |
| 531 | deps = [ |
| 532 | ":multinode_timestamp_filter", |
Austin Schuh | a9abc03 | 2021-01-01 16:46:19 -0800 | [diff] [blame] | 533 | ":testing_time_converter", |
Austin Schuh | 7466fe1 | 2020-12-29 23:01:47 -0800 | [diff] [blame] | 534 | ":timestamp_filter", |
| 535 | "//aos/testing:googletest", |
Austin Schuh | 87dd383 | 2021-01-01 23:07:31 -0800 | [diff] [blame] | 536 | "//third_party/gmp", |
Austin Schuh | 7466fe1 | 2020-12-29 23:01:47 -0800 | [diff] [blame] | 537 | "@com_github_stevengj_nlopt//:nlopt", |
| 538 | ], |
| 539 | ) |