Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 1 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
| 2 | |
| 3 | package(default_visibility = ["//visibility:public"]) |
| 4 | |
| 5 | flatbuffer_cc_library( |
| 6 | name = "test_message_fbs", |
| 7 | srcs = ["test_message.fbs"], |
| 8 | gen_reflections = 1, |
| 9 | ) |
| 10 | |
| 11 | flatbuffer_cc_library( |
| 12 | name = "pingpong_fbs", |
| 13 | srcs = ["pingpong.fbs"], |
| 14 | gen_reflections = 1, |
| 15 | ) |
| 16 | |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 17 | cc_library( |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 18 | name = "epoll", |
| 19 | srcs = ["epoll.cc"], |
| 20 | hdrs = ["epoll.h"], |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 21 | visibility = ["//visibility:public"], |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 22 | deps = [ |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 23 | "//aos/time", |
Austin Schuh | f257f3c | 2019-10-27 21:00:43 -0700 | [diff] [blame] | 24 | "@com_github_google_glog//:glog", |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 25 | ], |
| 26 | ) |
| 27 | |
| 28 | cc_library( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 29 | name = "event_loop", |
| 30 | srcs = ["event_loop_tmpl.h"], |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 31 | hdrs = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 32 | "event_loop.h", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 33 | ], |
| 34 | visibility = ["//visibility:public"], |
| 35 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 36 | "//aos:configuration", |
| 37 | "//aos:configuration_fbs", |
| 38 | "//aos:flatbuffers", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 39 | "//aos/time", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 40 | "@com_github_google_flatbuffers//:flatbuffers", |
| 41 | ], |
| 42 | ) |
| 43 | |
| 44 | cc_binary( |
| 45 | name = "ping", |
| 46 | srcs = [ |
| 47 | "ping.cc", |
| 48 | ], |
| 49 | data = ["config.fb.json"], |
| 50 | deps = [ |
| 51 | ":pingpong_fbs", |
| 52 | ":shm_event_loop", |
| 53 | "//aos:configuration", |
| 54 | "//aos:init", |
| 55 | "//aos:json_to_flatbuffer", |
| 56 | "@com_github_google_glog//:glog", |
| 57 | ], |
| 58 | ) |
| 59 | |
| 60 | cc_binary( |
| 61 | name = "pong", |
| 62 | srcs = [ |
| 63 | "pong.cc", |
| 64 | ], |
| 65 | data = ["config.fb.json"], |
| 66 | deps = [ |
| 67 | ":pingpong_fbs", |
| 68 | ":shm_event_loop", |
| 69 | "//aos:configuration", |
| 70 | "//aos:init", |
| 71 | "//aos:json_to_flatbuffer", |
| 72 | "@com_github_google_glog//:glog", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 73 | ], |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 74 | ) |
| 75 | |
| 76 | cc_library( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 77 | name = "shm_event_loop", |
| 78 | srcs = ["shm_event_loop.cc"], |
| 79 | hdrs = ["shm_event_loop.h"], |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 80 | visibility = ["//visibility:public"], |
| 81 | deps = [ |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 82 | ":epoll", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 83 | ":event_loop", |
| 84 | ":test_message_fbs", |
| 85 | "//aos:realtime", |
| 86 | "//aos/ipc_lib:lockless_queue", |
| 87 | "//aos/ipc_lib:signalfd", |
Austin Schuh | 52d325c | 2019-06-23 18:59:06 -0700 | [diff] [blame] | 88 | "//aos/util:phased_loop", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 89 | ], |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 90 | ) |
| 91 | |
| 92 | cc_test( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 93 | name = "shm_event_loop_test", |
| 94 | srcs = ["shm_event_loop_test.cc"], |
Austin Schuh | 6b6dfa5 | 2019-06-12 20:16:20 -0700 | [diff] [blame] | 95 | shard_count = 5, |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 96 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 97 | ":event_loop_param_test", |
| 98 | ":shm_event_loop", |
| 99 | ":test_message_fbs", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 100 | ], |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 101 | ) |
| 102 | |
| 103 | cc_library( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 104 | name = "event_loop_param_test", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 105 | testonly = True, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 106 | srcs = ["event_loop_param_test.cc"], |
| 107 | hdrs = ["event_loop_param_test.h"], |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 108 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 109 | ":event_loop", |
| 110 | ":test_message_fbs", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 111 | "//aos/testing:googletest", |
| 112 | ], |
Parker Schuh | e4a70d6 | 2017-12-27 20:10:20 -0800 | [diff] [blame] | 113 | ) |
Neil Balch | c8f41ed | 2018-01-20 22:06:53 -0800 | [diff] [blame] | 114 | |
| 115 | cc_test( |
Austin Schuh | 7267c53 | 2019-05-19 19:55:53 -0700 | [diff] [blame] | 116 | name = "simulated_event_loop_test", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 117 | srcs = ["simulated_event_loop_test.cc"], |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 118 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 119 | ":event_loop_param_test", |
Austin Schuh | 7267c53 | 2019-05-19 19:55:53 -0700 | [diff] [blame] | 120 | ":simulated_event_loop", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 121 | "//aos/testing:googletest", |
| 122 | ], |
Neil Balch | c8f41ed | 2018-01-20 22:06:53 -0800 | [diff] [blame] | 123 | ) |
| 124 | |
| 125 | cc_library( |
Austin Schuh | 7267c53 | 2019-05-19 19:55:53 -0700 | [diff] [blame] | 126 | name = "simulated_event_loop", |
Austin Schuh | 82c0c82 | 2019-05-27 19:55:20 -0700 | [diff] [blame] | 127 | testonly = True, |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 128 | srcs = [ |
| 129 | "event_scheduler.cc", |
| 130 | "simulated_event_loop.cc", |
| 131 | ], |
| 132 | hdrs = [ |
| 133 | "event_scheduler.h", |
| 134 | "simulated_event_loop.h", |
| 135 | ], |
Austin Schuh | 7267c53 | 2019-05-19 19:55:53 -0700 | [diff] [blame] | 136 | visibility = ["//visibility:public"], |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 137 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 138 | ":event_loop", |
| 139 | "//aos/ipc_lib:index", |
Austin Schuh | 52d325c | 2019-06-23 18:59:06 -0700 | [diff] [blame] | 140 | "//aos/util:phased_loop", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 141 | "@com_google_absl//absl/container:btree", |
Austin Schuh | a1654ed | 2019-01-27 17:24:54 -0800 | [diff] [blame] | 142 | ], |
Neil Balch | c8f41ed | 2018-01-20 22:06:53 -0800 | [diff] [blame] | 143 | ) |