| Build under buck2, with the toolchain pinned rather than found 460541b nandi 19d ago | 1 | # The C ABI Jolt loads for the UI: libvidya.so. |
| 2 | rust_library( |
| 3 | name = "vidya-ffi", |
| 4 | srcs = glob(["src/**/*.rs"]), |
| 5 | crate = "vidya", |
| 6 | crate_root = "src/lib.rs", |
| 7 | edition = "2021", |
| 8 | preferred_linkage = "shared", |
| 9 | # Without this buck names the library after the target — lib_vidya-ffi.so — |
| 10 | # and that name, not the filename, is what the linker writes into a |
| 11 | # dependent's DT_NEEDED. Every consumer looks for `libvidya`. |
| 12 | soname = "libvidya.so", |
| 13 | visibility = ["PUBLIC"], |
| 14 | # Cargo renames the dependency so the cdylib itself can keep the `vidya` |
| 15 | # crate name; mirror that here. |
| Build libvidya for the phone, and hold the glue that boots it d942053 nandi 19d ago | 16 | named_deps = select({ |
| 17 | "DEFAULT": {"vidya_core": "//crates/vidya-core:vidya"}, |
| 18 | # jni is renamed in third-party/rust/Cargo.toml, for the reason given |
| 19 | # there; the crate is `jni` to the source either way. |
| 20 | "prelude//os:android": { |
| 21 | "jni": "//third-party/rust:jni-0-22", |
| 22 | "vidya_core": "//crates/vidya-core:vidya", |
| 23 | }, |
| 24 | }), |
| Build under buck2, with the toolchain pinned rather than found 460541b nandi 19d ago | 25 | deps = [ |
| 26 | "//third-party/rust:egui", |
| 27 | "//third-party/rust:egui-winit", |
| 28 | "//third-party/rust:egui_glow", |
| 29 | "//third-party/rust:glow", |
| 30 | "//third-party/rust:glutin", |
| 31 | "//third-party/rust:glutin-winit", |
| 32 | "//third-party/rust:png", |
| 33 | "//third-party/rust:winit", |
| Build libvidya for the phone, and hold the glue that boots it d942053 nandi 19d ago | 34 | ] + select({ |
| 35 | # Reading a pasted picture off the clipboard, which arboard has no |
| 36 | # Android backend for; `vidya_open_url` is an ACTION_VIEW intent there |
| 37 | # and a JNI call. Mirrors the target-gated deps in Cargo.toml. |
| 38 | "DEFAULT": ["//third-party/rust:arboard"], |
| 39 | "prelude//os:android": [], |
| 40 | }), |
| Build under buck2, with the toolchain pinned rather than found 460541b nandi 19d ago | 41 | ) |