Skip to content

Commit

Permalink
Fix building arm64 wheel with cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Mar 21, 2022
1 parent 11d221e commit 08cccae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setuptools_rust/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ def run_for_extension(self, ext: RustExtension) -> None:
universal2 = False
if self.plat_name.startswith("macosx-") and arch_flags:
universal2 = "x86_64" in arch_flags and "arm64" in arch_flags
if not universal2 and not self.target:
if "arm64" in arch_flags:
self.target = "aarch64-apple-darwin"
elif "x86_64" in arch_flags:
self.target = "x86_64-apple-darwin"

if universal2:
arm64_dylib_paths = self.build_extension(ext, "aarch64-apple-darwin")
x86_64_dylib_paths = self.build_extension(ext, "x86_64-apple-darwin")
Expand Down

0 comments on commit 08cccae

Please sign in to comment.