Skip to content

Commit

Permalink
Merge pull request #1428 from PyO3/macos-arm64-cross
Browse files Browse the repository at this point in the history
Don't require PYO3_CROSS_LIB_DIR when compiling for x86_64 from macOS arm64 and reverse
  • Loading branch information
davidhewitt committed Feb 14, 2021
2 parents 07c7624 + ebc52c4 commit 7fa3b36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed
- Remove FFI definition `PyCFunction_ClearFreeList` for Python 3.9 and later. [#1425](https://github.com/PyO3/pyo3/pull/1425)
- `PYO3_CROSS_LIB_DIR` enviroment variable no long required when compiling for x86-64 Python from macOS arm64 and reverse. [#1428](https://github.com/PyO3/pyo3/pull/1428)

## [0.13.2] - 2021-02-12
### Packaging
Expand Down
9 changes: 9 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ fn cross_compiling() -> Result<Option<CrossCompileConfig>> {
return Ok(None);
}

if target == "x86_64-apple-darwin" && host == "aarch64-apple-darwin" {
// Not cross-compiling to compile for x86-64 Python from macOS arm64
return Ok(None);
}
if target == "aarch64-apple-darwin" && host == "x86_64-apple-darwin" {
// Not cross-compiling to compile for arm64 Python from macOS x86_64
return Ok(None);
}

if host.starts_with(&format!(
"{}-{}-{}",
env::var("CARGO_CFG_TARGET_ARCH")?,
Expand Down

0 comments on commit 7fa3b36

Please sign in to comment.