@@ -34,21 +34,21 @@ cc_proto_library(
3434
3535genrule (
3636 name = "lmp_packets_rs" ,
37- cmd = "pdlc --output-format rust $(location rust/lmp_packets.pdl) > $(location lmp_packets.rs)" ,
37+ cmd = "pdlc --output-format rust_legacy $(location rust/lmp_packets.pdl) > $(location lmp_packets.rs)" ,
3838 outs = ["lmp_packets.rs" ],
3939 srcs = ["rust/lmp_packets.pdl" ],
4040)
4141
4242genrule (
4343 name = "llcp_packets_rs" ,
44- cmd = "pdlc --output-format rust $(location rust/llcp_packets.pdl) > $(location llcp_packets.rs)" ,
44+ cmd = "pdlc --output-format rust_legacy $(location rust/llcp_packets.pdl) > $(location llcp_packets.rs)" ,
4545 outs = ["llcp_packets.rs" ],
4646 srcs = ["rust/llcp_packets.pdl" ],
4747)
4848
4949genrule (
5050 name = "hci_packets_rs" ,
51- cmd = "pdlc --output-format rust $(location //packets:hci_packets.pdl) > $(location hci_packets.rs)" ,
51+ cmd = "pdlc --output-format rust_legacy $(location //packets:hci_packets.pdl) > $(location hci_packets.rs)" ,
5252 outs = ["hci_packets.rs" ],
5353 srcs = ["//packets:hci_packets.pdl" ],
5454 visibility = ["//visibility:public" ],
@@ -103,10 +103,10 @@ rust_static_library(
103103 ],
104104)
105105
106- cc_library (
107- name = "rootcanal_lib" ,
106+ cc_binary (
107+ name = "librootcanal_ffi.so" ,
108+ linkopts = ["-shared" ],
108109 srcs = [
109- "desktop/test_environment.cc" ,
110110 "include/crypto/crypto.h" ,
111111 "include/hci/address.h" ,
112112 "include/hci/address_with_type.h" ,
@@ -116,7 +116,6 @@ cc_library(
116116 "include/phy.h" ,
117117 "lib/crypto/crypto.cc" ,
118118 "lib/hci/address.cc" ,
119- "lib/hci/pcap_filter.cc" ,
120119 "model/controller/acl_connection.cc" ,
121120 "model/controller/acl_connection.h" ,
122121 "model/controller/acl_connection_handler.cc" ,
@@ -134,58 +133,12 @@ cc_library(
134133 "model/controller/vendor_commands/csr.h" ,
135134 "model/controller/vendor_commands/le_apcf.cc" ,
136135 "model/controller/vendor_commands/le_apcf.h" ,
137- "model/devices/baseband_sniffer.cc" ,
138- "model/devices/baseband_sniffer.h" ,
139- "model/devices/beacon.cc" ,
140- "model/devices/beacon.h" ,
141- "model/devices/beacon_swarm.cc" ,
142- "model/devices/beacon_swarm.h" ,
136+ "model/controller/ffi.cc" ,
137+ "model/controller/ffi.h" ,
143138 "model/devices/device.cc" ,
144139 "model/devices/device.h" ,
145- "model/devices/hci_device.cc" ,
146- "model/devices/hci_device.h" ,
147- "model/devices/link_layer_socket_device.cc" ,
148- "model/devices/link_layer_socket_device.h" ,
149- "model/devices/sniffer.cc" ,
150- "model/devices/sniffer.h" ,
151- "model/hci/h4.h" ,
152- "model/hci/h4_data_channel_packetizer.cc" ,
153- "model/hci/h4_data_channel_packetizer.h" ,
154- "model/hci/h4_parser.cc" ,
155- "model/hci/h4_parser.h" ,
156- "model/hci/hci_sniffer.cc" ,
157- "model/hci/hci_sniffer.h" ,
158- "model/hci/hci_socket_transport.cc" ,
159- "model/hci/hci_socket_transport.h" ,
160- "model/hci/hci_transport.h" ,
161- "model/setup/async_manager.cc" ,
162- "model/setup/device_boutique.cc" ,
163- "model/setup/device_boutique.h" ,
164- "model/setup/phy_device.cc" ,
165- "model/setup/phy_device.h" ,
166- "model/setup/phy_layer.cc" ,
167- "model/setup/phy_layer.h" ,
168- "model/setup/test_channel_transport.cc" ,
169- "model/setup/test_channel_transport.h" ,
170- "model/setup/test_command_handler.cc" ,
171- "model/setup/test_command_handler.h" ,
172- "model/setup/test_model.cc" ,
173- "model/setup/test_model.h" ,
174- "net/async_data_channel.h" ,
175- "net/async_data_channel_connector.h" ,
176- "net/async_data_channel_server.h" ,
177- "net/posix/posix_async_socket.cc" ,
178- "net/posix/posix_async_socket.h" ,
179- "net/posix/posix_async_socket_connector.cc" ,
180- "net/posix/posix_async_socket_server.cc" ,
181140 "rust/include/rootcanal_rs.h" ,
182141 ],
183- hdrs = [
184- "desktop/test_environment.h" ,
185- "model/setup/async_manager.h" ,
186- "net/posix/posix_async_socket_connector.h" ,
187- "net/posix/posix_async_socket_server.h" ,
188- ],
189142 copts = [
190143 "-std=c++17" ,
191144 "-Wno-c99-designator" ,
@@ -210,16 +163,18 @@ cc_library(
210163 ":rootcanal_log" ,
211164 ":rootcanal_rs" ,
212165 "//packets:generated" ,
166+ "@pdl//:packet_runtime" ,
213167 "@fmtlib" ,
214168 "@openssl//:crypto" ,
215- "@pdl//:packet_runtime" ,
216169 ],
217170)
218171
219172cc_binary (
220- name = "librootcanal_ffi.so" ,
221- linkopts = ["-shared" ],
173+ name = "rootcanal" ,
222174 srcs = [
175+ "desktop/root_canal_main.cc" ,
176+ "desktop/test_environment.cc" ,
177+ "desktop/test_environment.h" ,
223178 "include/crypto/crypto.h" ,
224179 "include/hci/address.h" ,
225180 "include/hci/address_with_type.h" ,
@@ -229,6 +184,7 @@ cc_binary(
229184 "include/phy.h" ,
230185 "lib/crypto/crypto.cc" ,
231186 "lib/hci/address.cc" ,
187+ "lib/hci/pcap_filter.cc" ,
232188 "model/controller/acl_connection.cc" ,
233189 "model/controller/acl_connection.h" ,
234190 "model/controller/acl_connection_handler.cc" ,
@@ -246,10 +202,53 @@ cc_binary(
246202 "model/controller/vendor_commands/csr.h" ,
247203 "model/controller/vendor_commands/le_apcf.cc" ,
248204 "model/controller/vendor_commands/le_apcf.h" ,
249- "model/controller/ffi.cc" ,
250- "model/controller/ffi.h" ,
205+ "model/devices/baseband_sniffer.cc" ,
206+ "model/devices/baseband_sniffer.h" ,
207+ "model/devices/beacon.cc" ,
208+ "model/devices/beacon.h" ,
209+ "model/devices/beacon_swarm.cc" ,
210+ "model/devices/beacon_swarm.h" ,
251211 "model/devices/device.cc" ,
252212 "model/devices/device.h" ,
213+ "model/devices/hci_device.cc" ,
214+ "model/devices/hci_device.h" ,
215+ "model/devices/link_layer_socket_device.cc" ,
216+ "model/devices/link_layer_socket_device.h" ,
217+ "model/devices/sniffer.cc" ,
218+ "model/devices/sniffer.h" ,
219+ "model/hci/h4.h" ,
220+ "model/hci/h4_data_channel_packetizer.cc" ,
221+ "model/hci/h4_data_channel_packetizer.h" ,
222+ "model/hci/h4_parser.cc" ,
223+ "model/hci/h4_parser.h" ,
224+ "model/hci/hci_sniffer.cc" ,
225+ "model/hci/hci_sniffer.h" ,
226+ "model/hci/hci_socket_transport.cc" ,
227+ "model/hci/hci_socket_transport.h" ,
228+ "model/hci/hci_transport.h" ,
229+ "model/setup/async_manager.cc" ,
230+ "model/setup/async_manager.h" ,
231+ "model/setup/device_boutique.cc" ,
232+ "model/setup/device_boutique.h" ,
233+ "model/setup/phy_device.cc" ,
234+ "model/setup/phy_device.h" ,
235+ "model/setup/phy_layer.cc" ,
236+ "model/setup/phy_layer.h" ,
237+ "model/setup/test_channel_transport.cc" ,
238+ "model/setup/test_channel_transport.h" ,
239+ "model/setup/test_command_handler.cc" ,
240+ "model/setup/test_command_handler.h" ,
241+ "model/setup/test_model.cc" ,
242+ "model/setup/test_model.h" ,
243+ "net/async_data_channel.h" ,
244+ "net/async_data_channel_connector.h" ,
245+ "net/async_data_channel_server.h" ,
246+ "net/posix/posix_async_socket.cc" ,
247+ "net/posix/posix_async_socket.h" ,
248+ "net/posix/posix_async_socket_connector.cc" ,
249+ "net/posix/posix_async_socket_connector.h" ,
250+ "net/posix/posix_async_socket_server.cc" ,
251+ "net/posix/posix_async_socket_server.h" ,
253252 "rust/include/rootcanal_rs.h" ,
254253 ],
255254 copts = [
@@ -276,27 +275,12 @@ cc_binary(
276275 ":rootcanal_log" ,
277276 ":rootcanal_rs" ,
278277 "//packets:generated" ,
279- "@pdl//:packet_runtime " ,
278+ "@gflags " ,
280279 "@fmtlib" ,
281280 "@openssl//:crypto" ,
281+ "@pdl//:packet_runtime" ,
282282 ],
283- )
284-
285- cc_binary (
286- name = "rootcanal" ,
287- srcs = ["desktop/root_canal_main.cc" ],
288- copts = ["-std=c++17" ],
289283 # TODO enable thin_lto
290284 # breaks the device registration
291285 # features = ["-thin_lto"],
292- visibility = ["//visibility:public" ],
293- deps = [
294- ":rootcanal_lib" ,
295- ":rootcanal_config" ,
296- ":rootcanal_log" ,
297- ":rootcanal_rs" ,
298- "@gflags" ,
299- "@fmtlib" ,
300- "@openssl//:crypto" ,
301- ],
302286)
0 commit comments