four-bar-ui 4.0.0

Four🍀bar GUI is a simulator, a synthesizing tool for four-bar linkages.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[cfg(not(windows))]
fn main() {}

#[cfg(windows)]
fn main() {
    let profile = std::env::var("PROFILE").unwrap();
    let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
    if target_env == "gnu" || target_env == "msvc" && profile == "release" {
        let out = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
        let ico = image::open("assets/favicon.png").unwrap();
        let ico_path = out.join("icon.ico");
        ico.save(&ico_path).unwrap();
        winres::WindowsResource::new()
            .set_icon(ico_path.to_str().unwrap())
            .compile()
            .unwrap_or_default();
    }
}