Skip to content

Commit

Permalink
Merge #1251
Browse files Browse the repository at this point in the history
1251: Set default macOS deployment target version if not specified r=messense a=messense

Fixes #1247 

Co-authored-by: messense <[email protected]>
  • Loading branch information
bors[bot] and messense authored Nov 5, 2022
2 parents d6c6bed + 134f424 commit e74b2a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Fix auditwheel `libpython` check on Python 3.7 and older versions in [#1229](https://github.com/PyO3/maturin/pull/1229)
* Use generic tags when `sys.implementation.name` != `platform.python_implementation()` in [#1232](https://github.com/PyO3/maturin/pull/1232).
Fixes the compatibility tags for Pyston.
* Set default macOS deployment target version if `MACOSX_DEPLOYMENT_TARGET` isn't specified in [#1251](https://github.com/PyO3/maturin/pull/1251)

## [0.13.7] - 2022-10-29

Expand Down
11 changes: 10 additions & 1 deletion src/compile.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::build_context::BridgeModel;
use crate::target::RUST_1_64_0;
use crate::target::{Arch, RUST_1_64_0};
use crate::{BuildContext, PlatformTag, PythonInterpreter, Target};
use anyhow::{anyhow, bail, Context, Result};
use fat_macho::FatWriter;
Expand Down Expand Up @@ -384,6 +384,15 @@ fn compile_target(
build_command.env("PYO3_CROSS_LIB_DIR", lib_dir);
}

// Set default macOS deployment target version
if target.is_macos() && env::var_os("MACOSX_DEPLOYMENT_TARGET").is_none() {
let min_version = match target.target_arch() {
Arch::Aarch64 => "11.0",
_ => "10.7",
};
build_command.env("MACOSX_DEPLOYMENT_TARGET", min_version);
}

let mut cargo_build = build_command
.spawn()
.context("Failed to run `cargo rustc`")?;
Expand Down

0 comments on commit e74b2a8

Please sign in to comment.