Skip to content

Commit 52b4d85

Browse files
author
Vladimir Safonkin
authored
Merge pull request actions#114 from bwoodsend/universal2
Compile in universal2 mode for macOS Python >= 3.9.1.
2 parents c3505cc + 3c5fa6d commit 52b4d85

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

builders/macos-python-builder.psm1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ class macOSPythonBuilder : NixPythonBuilder {
4242
$configureString += " --enable-shared"
4343
$configureString += " --with-lto"
4444

45+
### For Python versions which support it, compile a universal2 (arm64 + x86_64 hybrid) build. The arm64 slice
46+
### will never be used itself by a Github Actions runner but using a universal2 Python is the only way to build
47+
### universal2 C extensions and wheels. This is supported by Python >= 3.10 and was backported to Python >=
48+
### 3.9.1 and >= 3.8.10.
49+
if ($this.Version -ge "3.8.10" -and $this.Version -ne "3.9.0" ) {
50+
$configureString += " --enable-universalsdk --with-universal-archs=universal2"
51+
}
52+
4553
### OS X 10.11, Apple no longer provides header files for the deprecated system version of OpenSSL.
4654
### Solution is to install these libraries from a third-party package manager,
4755
### and then add the appropriate paths for the header and library files to configure command.

0 commit comments

Comments
 (0)