Skip to content

Commit

Permalink
Fix cross compiling to aarch64 macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Mar 4, 2022
1 parent 4b65ad8 commit afe5221
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 @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fix incorrect platform detection for Windows in `pyo3-build-config`. [#2198](https://github.com/PyO3/pyo3/pull/2198)
- Fix cross compiling to aarch64 macOS. [#2201](https://github.com/PyO3/pyo3/pull/2201)

## [0.16.0] - 2022-02-27

Expand Down
11 changes: 10 additions & 1 deletion pyo3-build-config/src/impl_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,16 @@ pub fn cross_compiling(
let cross_lib_dir = env_var("PYO3_CROSS_LIB_DIR");
let cross_python_version = env_var("PYO3_CROSS_PYTHON_VERSION");

let target_triple = format!("{}-{}-{}", target_arch, target_vendor, target_os);
let target_triple = format!(
"{}-{}-{}",
target_arch,
target_vendor,
if target_os == "macos" {
"darwin"
} else {
target_os
}
);

if cross.is_none() && cross_lib_dir.is_none() && cross_python_version.is_none() {
// No cross-compiling environment variables set; try to determine if this is a known case
Expand Down

0 comments on commit afe5221

Please sign in to comment.