Skip to content

Commit a135313

Browse files
committed
Ensure a consistent macOS minSDK version is used.
1 parent a1d326a commit a135313

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Makefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ PROJECT_DIR=$(shell pwd)
3636
BUILD_NUMBER=custom
3737

3838
# This version limit will only be honored on x86_64 builds.
39-
# arm64/M1 builds are only supporteded on macOS 11.0 or greater.
40-
MACOSX_DEPLOYMENT_TARGET-x86_64=10.8
41-
MACOSX_DEPLOYMENT_TARGET-arm64=11.0
39+
MACOSX_DEPLOYMENT_TARGET=10.15
4240

4341
# Version of packages that will be compiled by this meta-package
4442
# PYTHON_VERSION is the full version number (e.g., 3.10.0b3)
@@ -64,10 +62,12 @@ OS_LIST=macOS iOS tvOS watchOS
6462

6563
# macOS targets
6664
TARGETS-macOS=macosx.x86_64 macosx.arm64
67-
CFLAGS-macOS=
68-
CFLAGS-macosx.x86_64=-mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET-x86_64)
69-
CFLAGS-macosx.arm64=-mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET-arm64)
65+
CFLAGS-macOS=-mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
66+
CFLAGS-macosx.x86_64=
67+
CFLAGS-macosx.arm64=
7068
SLICE-macosx=macos-arm64_x86_64
69+
SDK_ROOT-macosx=$(shell xcrun --sdk macosx --show-sdk-path)
70+
CC-macosx=xcrun --sdk macosx clang --sysroot=$(SDK_ROOT-macosx) $(CFLAGS-macOS)
7171

7272
# iOS targets
7373
TARGETS-iOS=iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64
@@ -106,6 +106,8 @@ MACHINE_SIMPLE-arm64=arm
106106
MACHINE_DETAILED-arm64_32=aarch64
107107
MACHINE_SIMPLE-arm64_32=arm
108108

109+
110+
109111
# The architecture of the machine doing the build
110112
HOST_ARCH=$(shell uname -m)
111113

@@ -800,8 +802,9 @@ $$(PYTHON_DIR-$(os))/Makefile: \
800802
> $$(PYTHON_DIR-$(os))/Modules/Setup.local
801803
# Configure target Python
802804
cd $$(PYTHON_DIR-$(os)) && \
803-
MACOSX_DEPLOYMENT_TARGET=$$(MACOSX_DEPLOYMENT_TARGET-$$(ARCH-$(target))) \
805+
MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET) \
804806
./configure \
807+
CC="$(CC-macosx)" LD="$(CC-macosx)" \
805808
--prefix="$(PROJECT_DIR)/$$(PYTHON_DIR-$(os))/_install" \
806809
--without-doc-strings --enable-ipv6 --without-ensurepip --enable-universalsdk --with-universal-archs=universal2 \
807810
--with-openssl=../openssl/macosx \

0 commit comments

Comments
 (0)