Files

15 lines
523 B
Rust

use std::env;
fn main() {
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").expect("target arch env");
let style = match target_arch.as_str() {
// For web, rely on dark mod detection based on browser settings.
"wasm32" => "cosmic",
// For any other target, force dark mode.
_ => "cosmic-dark",
};
let config = slint_build::CompilerConfiguration::new().with_style(style.into());
slint_build::compile_with_config("ui/app.slint", config).expect("Slint build failed");
}