diff --git a/CHANGELOG.md b/CHANGELOG.md index eca24f7a..a8b9147c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/setuptools_rust/build.py b/setuptools_rust/build.py index 9f46cc15..1cb5de62 100644 --- a/setuptools_rust/build.py +++ b/setuptools_rust/build.py @@ -1,6 +1,7 @@ import glob import json import os +import platform import shutil import sys import subprocess @@ -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]