File
Blob: src/rust/worker/BUILD
| 1 | load("//:build/kj_test.bzl", "kj_test") |
| 2 | load("//:build/wd_cc_library.bzl", "wd_cc_library") |
| 3 | load("//:build/wd_rust_crate.bzl", "wd_rust_crate") |
| 4 | |
| 5 | wd_rust_crate( |
| 6 | name = "worker", |
| 7 | cxx_bridge_deps = { |
| 8 | "ffi.rs": [ |
| 9 | "@workerd//src/workerd/io:worker-interface", |
| 10 | "@workerd//src/rust/kj", |
| 11 | ], |
| 12 | "error.rs": [ |
| 13 | ":ffi.rs@cxx", |
| 14 | ], |
| 15 | "kill_switch.rs": [ |
| 16 | ":ffi.rs@cxx", |
| 17 | ], |
| 18 | "ok.rs": [ |
| 19 | ":ffi.rs@cxx", |
| 20 | ], |
| 21 | }, |
| 22 | cxx_bridge_srcs = [ |
| 23 | "error.rs", |
| 24 | "ffi.rs", |
| 25 | "kill_switch.rs", |
| 26 | "ok.rs", |
| 27 | ], |
| 28 | proc_macro_deps = [ |
| 29 | "@crates_vendor//:async-trait", |
| 30 | ], |
| 31 | visibility = ["//visibility:public"], |
| 32 | deps = [ |
| 33 | ":bridge", |
| 34 | "@workerd//src/rust/kj", |
| 35 | "@workerd//src/workerd/io:outcome_capnp_rust", |
| 36 | ], |
| 37 | ) |
| 38 | |
| 39 | wd_cc_library( |
| 40 | name = "bridge", |
| 41 | hdrs = ["bridge.h"], |
| 42 | deps = [ |
| 43 | ":ffi.rs@cxx", |
| 44 | "@capnp-cpp//src/kj", |
| 45 | "@capnp-cpp//src/kj/compat:kj-http", |
| 46 | "@workerd//src/workerd/io:worker-interface", |
| 47 | "@workerd//src/workerd/util", |
| 48 | ], |
| 49 | ) |
| 50 | |
| 51 | kj_test( |
| 52 | src = "test.c++", |
| 53 | deps = [ |
| 54 | ":worker", |
| 55 | "@capnp-cpp//src/kj:kj-async", |
| 56 | "@capnp-cpp//src/kj/compat:kj-http", |
| 57 | "@workerd//src/workerd/io", |
| 58 | "@workerd//src/workerd/io:frankenvalue", |
| 59 | ], |
| 60 | ) |