From 0c1dbdff92c34eb9189bafaf8683b4da0e63d9fd Mon Sep 17 00:00:00 2001 From: Guilhem Vallat Date: Fri, 23 Jun 2023 15:56:36 +0200 Subject: [PATCH] fix: ensure cross-build compatibility of build.rs --- build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index 72f7559..e498f50 100644 --- a/build.rs +++ b/build.rs @@ -4,11 +4,11 @@ use std::env; const DEPLOYMENT_TARGET_VAR: &str = "MACOSX_DEPLOYMENT_TARGET"; fn main() { - if cfg!(target_os = "macos") { + if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("macos") { let min_version = match env::var(DEPLOYMENT_TARGET_VAR) { Ok(ver) => ver, Err(_) => String::from(match env::var("CARGO_CFG_TARGET_ARCH").unwrap().as_str() { - "x86_64" => "10.8", // NSUserNotificationCenter first showed up here. + "x86_64" => "10.8", // NSUserNotificationCenter first showed up here. "aarch64" => "11.0", // Apple silicon started here. arch => panic!("unknown arch: {}", arch), }),