forked from shinkuan/Akagi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
26 lines (21 loc) · 1 KB
/
Copy pathbuild.rs
File metadata and controls
26 lines (21 loc) · 1 KB
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
use std::{env, path::PathBuf};
fn main() {
let out_dir = PathBuf::from(env::var("OUT_DIR").expect("OUT_DIR not set"));
prost_build::Config::new()
.type_attribute(".", "#[allow(dead_code)]")
.file_descriptor_set_path(out_dir.join("liqi_desc.bin"))
.compile_protos(
&["src/bridge/majsoul/proto/liqi.proto"],
&["src/bridge/majsoul/proto/"],
)
.expect("failed to compile liqi.proto");
println!("cargo:rerun-if-changed=src/bridge/majsoul/proto/liqi.proto");
println!("cargo:rerun-if-changed=build.rs");
// Surface the build target triple to runtime code so it can pick the
// right bundled python-build-standalone / uv binary out of the Tauri
// resource dir. Cargo only exposes this via the `TARGET` env var at
// build time; we forward it as `TARGET_TRIPLE` for the binary.
let target = env::var("TARGET").expect("TARGET not set by cargo");
println!("cargo:rustc-env=TARGET_TRIPLE={target}");
tauri_build::build();
}