-
-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathbuild.rs
More file actions
23 lines (20 loc) · 758 Bytes
/
Copy pathbuild.rs
File metadata and controls
23 lines (20 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
fn main() -> std::io::Result<()> {
println!("cargo:rerun-if-changed=assets/ratty.ico");
println!("cargo:rerun-if-changed=build.rs");
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {
return Ok(());
}
let mut resource = winresource::WindowsResource::new();
resource.set_icon("assets/ratty.ico").set_manifest(
r#"<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application>
<windowsSettings>
<consoleAllocationPolicy xmlns="http://schemas.microsoft.com/SMI/2024/WindowsSettings">detached</consoleAllocationPolicy>
</windowsSettings>
</application>
</assembly>
"#,
);
resource.compile()
}