Files
RustyUI/crates/stable-diffusion-burn/burn-crates/burn-dispatch/build.rs
Ben_Kosytorz 3a67c0979c feat: update workspace paths and enhance gitignore
- Updated stablediffusion crate path from "../stable-diffusion-burn" to "./crates/stable-diffusion-burn" for proper workspace resolution
- Enhanced .gitignore to include generated model files (.mpk, .pt, .bin, .safetensors, .ckpt) and user_data directory
- Added Cargo.lock to gitignore with appropriate comment
- Reorganized IDE files section in gitignore for better clarity
- Added newline at end of file for proper formatting
2026-03-05 19:39:14 +01:00

36 lines
1.3 KiB
Rust

fn main() {
println!("cargo::rustc-check-cfg=cfg(wgpu_metal)");
println!("cargo::rustc-check-cfg=cfg(wgpu_vulkan)");
println!("cargo::rustc-check-cfg=cfg(wgpu_webgpu)");
// Detect which single wgpu backend is enabled
let metal = cfg!(feature = "metal");
let vulkan = cfg!(feature = "vulkan");
let webgpu = cfg!(feature = "webgpu");
let enabled = [(metal, "metal"), (vulkan, "vulkan"), (webgpu, "webgpu")]
.iter()
.filter(|x| x.0)
.map(|x| x.1)
.collect::<Vec<_>>();
// WGPU features are mutually exclusive, but we don't want to workspace to throw a compile error.
// In workspace builds with multiple features, we emit a warning and disable all WGPU backends.
if enabled.len() > 1 {
println!(
"cargo:warning=Only one WGPU backend can be enabled at once. Detected: [{}]. No WGPU backend will be available in this build. This is expected in workspace builds. For production, enable only one of: metal, vulkan, or webgpu.",
enabled.join(", ")
);
return;
}
if metal {
println!("cargo:rustc-cfg=wgpu_metal");
}
if vulkan {
println!("cargo:rustc-cfg=wgpu_vulkan");
}
if webgpu {
println!("cargo:rustc-cfg=wgpu_webgpu");
}
}