fix: cross compiling for windows from linux

#[cfg(not(unix))] applies to the host machine (since that's where the
build script is running) rather than the compilation target. Instead,
environment variables are available to provide the information relevant
to the build target at the build script's runtime.
This commit is contained in:
Kyle Scheuing 2025-12-04 13:21:34 -05:00 committed by Jeremy Soller
parent 80875d5962
commit 54934a961f

View file

@ -1,11 +1,13 @@
use std::env;
fn main() {
println!("cargo::rerun-if-changed=build.rs");
#[cfg(not(unix))]
generate_bundled_icons();
if env::var_os("CARGO_CFG_UNIX").is_none() {
generate_bundled_icons();
}
}
#[cfg(not(unix))]
fn generate_bundled_icons() {
println!("cargo::rerun-if-changed=cosmic-icons");