Add winres build step for icon

This commit is contained in:
IndyV 2022-11-04 10:15:45 +01:00
parent cb2bcfed06
commit 82efc80286
4 changed files with 32 additions and 0 deletions

19
Cargo.lock generated
View File

@ -1076,6 +1076,7 @@ dependencies = [
"serde_json", "serde_json",
"tinyfiledialogs", "tinyfiledialogs",
"tokio", "tokio",
"winres",
] ]
[[package]] [[package]]
@ -1282,6 +1283,15 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "toml"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "tower-service" name = "tower-service"
version = "0.3.2" version = "0.3.2"
@ -1545,6 +1555,15 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "winres"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
dependencies = [
"toml",
]
[[package]] [[package]]
name = "zeroize" name = "zeroize"
version = "1.5.7" version = "1.5.7"

View File

@ -2,6 +2,10 @@
name = "sharextended" name = "sharextended"
version = "0.2.0" version = "0.2.0"
edition = "2021" edition = "2021"
build = "build.rs"
[target.'cfg(windows)'.build-dependencies]
winres = "0.1"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

9
build.rs Normal file
View File

@ -0,0 +1,9 @@
extern crate winres;
fn main() {
if cfg!(target_os = "windows") {
let mut res = winres::WindowsResource::new();
res.set_icon("test.ico");
res.compile().unwrap();
}
}

BIN
test.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB