Feat: big movement for ASIO
This commit is contained in:
23
build.rs
23
build.rs
@@ -4,8 +4,6 @@ fn main() {
|
||||
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
|
||||
|
||||
if target_os == "windows" {
|
||||
// C++ runtime (stdc++, gcc, gcc_eh, pthread) linked statically via .cargo/config.toml
|
||||
// using -Wl,-Bstatic. Only Windows system DLLs go here.
|
||||
println!("cargo:rustc-link-lib=ws2_32");
|
||||
println!("cargo:rustc-link-lib=iphlpapi");
|
||||
println!("cargo:rustc-link-lib=winmm");
|
||||
@@ -16,23 +14,12 @@ fn main() {
|
||||
if target_os == "windows" {
|
||||
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||
let icon = format!("{manifest_dir}/assets/Cagire.ico");
|
||||
let mut res = winres::WindowsResource::new();
|
||||
// Cross-compiling from Unix: use prefixed MinGW tools
|
||||
if cfg!(unix) {
|
||||
res.set_windres_path("x86_64-w64-mingw32-windres");
|
||||
res.set_ar_path("x86_64-w64-mingw32-ar");
|
||||
res.set_toolkit_path("/");
|
||||
}
|
||||
res.set_icon(&icon)
|
||||
winresource::WindowsResource::new()
|
||||
.set_icon(&icon)
|
||||
.set("ProductName", "Cagire")
|
||||
.set("FileDescription", "Forth-based music sequencer")
|
||||
.set("LegalCopyright", "Copyright (c) 2025 Raphaël Forment");
|
||||
res.compile().expect("Failed to compile Windows resources");
|
||||
// GNU ld discards unreferenced sections from static archives,
|
||||
// so link the resource object directly to ensure .rsrc is kept.
|
||||
if cfg!(unix) {
|
||||
let out_dir = std::env::var("OUT_DIR").unwrap();
|
||||
println!("cargo:rustc-link-arg-bins={out_dir}/resource.o");
|
||||
}
|
||||
.set("LegalCopyright", "Copyright (c) 2025 Raphaël Forment")
|
||||
.compile()
|
||||
.expect("Failed to compile Windows resources");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user