-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
39 lines (31 loc) · 1013 Bytes
/
Copy pathbuild.rs
File metadata and controls
39 lines (31 loc) · 1013 Bytes
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
use std::{env, fs};
fn main() {
let profile = env::var("PROFILE").unwrap();
match profile.as_str() {
"release" => {
fs::copy("notfound.png", "target/release/notfound.png").unwrap();
}
"debug" => {
fs::copy("notfound.png", "target/debug/notfound.png").unwrap();
}
_ => {
panic!("This shouldn't happen, cargo profile: {}", profile);
}
}
let mut config = slint_build::CompilerConfiguration::new().with_style("qt".into());
match std::env::consts::OS {
"windows" => {
config = config.with_style("fluent".into());
}
"linux" => {
config = config.with_style("cosmic".into());
}
"macos" => {
config = config.with_style("cupertino".into());
}
_ => {
config = config.with_style("qt".into());
}
}
slint_build::compile_with_config("ui/app-window.slint", config).expect("Slint build failed");
}