add icon on windows
This commit is contained in:
parent
3bb155e728
commit
dc6386d428
5 changed files with 39 additions and 10 deletions
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -774,6 +774,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crossterm",
|
"crossterm",
|
||||||
"rodio",
|
"rodio",
|
||||||
|
"winres",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1082,3 +1083,12 @@ name = "windows_x86_64_msvc"
|
||||||
version = "0.42.1"
|
version = "0.42.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
|
checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winres"
|
||||||
|
version = "0.1.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
|
||||||
|
dependencies = [
|
||||||
|
"toml",
|
||||||
|
]
|
||||||
|
|
23
Cargo.toml
23
Cargo.toml
|
@ -1,10 +1,13 @@
|
||||||
[package]
|
[package]
|
||||||
name = "snoud"
|
name = "snoud"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
crossterm = "0.25.0"
|
crossterm = "0.25.0"
|
||||||
rodio = { version = "0.16.0", default_features = false, features = ["mp3"] }
|
rodio = { version = "0.16.0", default_features = false, features = ["mp3"] }
|
||||||
|
|
||||||
|
[target.'cfg(windows)'.build-dependencies]
|
||||||
|
winres = "0.1.12"
|
||||||
|
|
15
build.rs
Normal file
15
build.rs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
use std::io;
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
use winres::WindowsResource;
|
||||||
|
|
||||||
|
fn main() -> io::Result<()> {
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
{
|
||||||
|
WindowsResource::new().set_icon("icon.ico").compile()
|
||||||
|
}
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
|
{
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
BIN
icon.ico
Normal file
BIN
icon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
1
rustfmt.toml
Normal file
1
rustfmt.toml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
hard_tabs = true
|
Loading…
Reference in a new issue