Skip to content

Commit 303fa40

Browse files
Support building x86-64 wheel on arm64 macOS machine (#114)
Co-authored-by: David Hewitt <[email protected]>
1 parent 1e37cc8 commit 303fa40

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
### Packaging
55
- Bump minimum Python version to Python 3.6.
66

7+
### Added
8+
- Support building x86-64 wheel on arm64 macOS machine. [#114](https://github.com/PyO3/setuptools-rust/pull/114)
9+
710
### Changed
811
- Respect `PYO3_PYTHON` and `PYTHON_SYS_EXECUTABLE` environment variables if set. [#96](https://github.com/PyO3/setuptools-rust/pull/96)
912
- Add runtime dependency on setuptools >= 46.1. [#102](https://github.com/PyO3/setuptools-rust/pull/102)

setuptools_rust/build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import glob
22
import json
33
import os
4+
import platform
45
import shutil
56
import sys
67
import subprocess
@@ -95,6 +96,9 @@ def run_for_extension(self, ext: RustExtension):
9596
target_triple = "i686-pc-windows-msvc"
9697
elif self.plat_name == "win-amd64":
9798
target_triple = "x86_64-pc-windows-msvc"
99+
elif self.plat_name.startswith("macosx-") and platform.machine() == "x86_64":
100+
# x86_64 or arm64 macOS targeting x86_64
101+
target_triple = "x86_64-apple-darwin"
98102

99103
if target_triple is not None:
100104
target_args = ["--target", target_triple]

0 commit comments

Comments
 (0)