-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
21 lines (18 loc) · 823 Bytes
/
Copy pathbuild.rs
File metadata and controls
21 lines (18 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::env;
use std::fs;
use std::path::Path;
fn main() {
// Get the output directory from cargo
let out_dir = env::var("OUT_DIR").unwrap();
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
// Source and destination paths for the Metal shader
let src_path = Path::new(&manifest_dir).join("aiSimulator/assets/metal_location_search.metal");
let dest_path = Path::new(&out_dir).join("../../../metal_location_search.metal");
// Copy the Metal shader file
println!("cargo:rerun-if-changed=aiSimulator/assets/metal_location_search.metal");
if let Err(e) = fs::copy(&src_path, &dest_path) {
println!("cargo:warning=Failed to copy Metal shader: {}", e);
} else {
println!("cargo:warning=Successfully copied Metal shader to: {}", dest_path.display());
}
}