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
parent 80875d5962
commit bc3c27d735
No known key found for this signature in database
GPG key ID: 72CE2DDCDA12B906

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");