Skip to content

Commit

Permalink
Support building x86-64 wheel on arm64 macOS machine (#114)
Browse files Browse the repository at this point in the history
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
  • Loading branch information
messense and davidhewitt authored Feb 15, 2021
1 parent 1e37cc8 commit 303fa40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
### Packaging
- Bump minimum Python version to Python 3.6.

### Added
- Support building x86-64 wheel on arm64 macOS machine. [#114](https://github.com/PyO3/setuptools-rust/pull/114)

### Changed
- Respect `PYO3_PYTHON` and `PYTHON_SYS_EXECUTABLE` environment variables if set. [#96](https://github.com/PyO3/setuptools-rust/pull/96)
- Add runtime dependency on setuptools >= 46.1. [#102](https://github.com/PyO3/setuptools-rust/pull/102)
Expand Down
4 changes: 4 additions & 0 deletions setuptools_rust/build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import glob
import json
import os
import platform
import shutil
import sys
import subprocess
Expand Down Expand Up @@ -95,6 +96,9 @@ def run_for_extension(self, ext: RustExtension):
target_triple = "i686-pc-windows-msvc"
elif self.plat_name == "win-amd64":
target_triple = "x86_64-pc-windows-msvc"
elif self.plat_name.startswith("macosx-") and platform.machine() == "x86_64":
# x86_64 or arm64 macOS targeting x86_64
target_triple = "x86_64-apple-darwin"

if target_triple is not None:
target_args = ["--target", target_triple]
Expand Down

0 comments on commit 303fa40

Please sign in to comment.