26 lines
970 B
Rust
26 lines
970 B
Rust
//! Build script — embeds Windows application resources (icon, metadata).
|
|
|
|
fn main() {
|
|
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
|
|
|
|
if target_os == "windows" {
|
|
println!("cargo:rustc-link-lib=ws2_32");
|
|
println!("cargo:rustc-link-lib=iphlpapi");
|
|
println!("cargo:rustc-link-lib=winmm");
|
|
println!("cargo:rustc-link-lib=ole32");
|
|
println!("cargo:rustc-link-lib=oleaut32");
|
|
}
|
|
|
|
if target_os == "windows" {
|
|
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
let icon = format!("{manifest_dir}/assets/Cagire.ico");
|
|
winresource::WindowsResource::new()
|
|
.set_icon(&icon)
|
|
.set("ProductName", "Cagire")
|
|
.set("FileDescription", "Forth-based music sequencer")
|
|
.set("LegalCopyright", "Copyright (c) 2025 Raphaël Forment")
|
|
.compile()
|
|
.expect("Failed to compile Windows resources");
|
|
}
|
|
}
|