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