Skip to content

Commit

Permalink
fix: ensure cross-build compatibility of build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Guiguiprim authored and hoodie committed Jul 23, 2023
1 parent 7ab3864 commit 0c1dbdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}),
Expand Down

0 comments on commit 0c1dbdf

Please sign in to comment.