From 89aded62e06d25d0c91ae7cbbfc51d244716a115 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Tue, 12 Oct 2021 18:06:40 +0200 Subject: [PATCH] fix(core): add support for older macOS versions. Fix #785 --- scripts/build_binary.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/build_binary.rs b/scripts/build_binary.rs index fa316ed..a2f98c4 100644 --- a/scripts/build_binary.rs +++ b/scripts/build_binary.rs @@ -67,6 +67,17 @@ fn main() { let mut cmd = Command::new("cargo"); cmd.args(&args); + // If compiling for macOS x86-64, set the minimum supported version + // to 10.13 + let is_macos = cfg!(target_os = "macos"); + let is_x86_arch = cfg!(target_arch = "x86_64"); + if is_macos + && (override_target_arch == "current" && is_x86_arch + || override_target_arch == "x86_64-apple-darwin") + { + cmd.env("MACOSX_DEPLOYMENT_TARGET", "10.13"); + } + // Remove cargo/rust-specific env variables, as otherwise they mess up the // nested cargo build call. let all_vars = envmnt::vars();