skip unnecessary set_icon() during build script (fix #681)

This commit is contained in:
GyulyVGC
2025-02-16 11:35:38 +01:00
parent ddc1e173c4
commit 04f86db3a2
4 changed files with 6 additions and 42 deletions

View File

@@ -77,16 +77,16 @@ jobs:
cargo clippy --release -- -D warnings &&
cargo clean
- name: Install Cross
if: matrix.os == 'ubuntu'
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Check crate
if: matrix.os == 'macos' || matrix.os == 'windows' || matrix.os == 'ubuntu' && matrix.arch == 'amd64'
run: |
cargo publish --dry-run --target ${{ matrix.target }} &&
cargo clean
- name: Install Cross
if: matrix.os == 'ubuntu'
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build binary (Linux)
if: matrix.os == 'ubuntu'
run: cross build --release --target ${{ matrix.target }}

23
Cargo.lock generated
View File

@@ -816,7 +816,7 @@ dependencies = [
"directories",
"serde",
"thiserror 1.0.69",
"toml 0.8.20",
"toml",
]
[[package]]
@@ -4522,8 +4522,7 @@ dependencies = [
"serde_test",
"serial_test",
"splines",
"toml 0.8.20",
"winres",
"toml",
]
[[package]]
@@ -4945,15 +4944,6 @@ dependencies = [
"tokio",
]
[[package]]
name = "toml"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
dependencies = [
"serde",
]
[[package]]
name = "toml"
version = "0.8.20"
@@ -6079,15 +6069,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "winres"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
dependencies = [
"toml 0.5.11",
]
[[package]]
name = "wit-bindgen-rt"
version = "0.33.0"

View File

@@ -22,7 +22,6 @@ include = [
"/resources/fonts/subset/*.ttf",
"/resources/sounds/*.mp3",
"/services.txt",
"/resources/packaging/windows/graphics/sniffnet.ico",
"/build.rs",
]
@@ -80,9 +79,6 @@ phf_shared = "0.11.2"
rustrict = { version = "0.7.33", default-features = false, features = ["censor"] }
once_cell = "1.20.3"
[target."cfg(windows)".build-dependencies]
winres = "0.1.12"
#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
[badges]

View File

@@ -1,6 +1,3 @@
#[cfg(windows)]
extern crate winres;
use std::env;
use std::fs::File;
use std::io::{BufRead, BufReader, BufWriter, Write};
@@ -19,19 +16,9 @@ fn main() {
println!("cargo:rerun-if-changed={WINDOWS_ICON_PATH}");
println!("cargo:rerun-if-changed={SERVICES_LIST_PATH}");
set_icon();
build_services_phf();
}
fn set_icon() {
#[cfg(windows)]
{
let mut res = winres::WindowsResource::new();
res.set_icon(WINDOWS_ICON_PATH);
res.compile().unwrap();
}
}
fn build_services_phf() {
let out_path = Path::new(&env::var("OUT_DIR").unwrap()).join("services.rs");
let mut output = BufWriter::new(File::create(out_path).unwrap());