From 4ff52ae8d0ac727805524f8fbdcbfae92db2579d Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Fri, 29 Jan 2021 15:22:32 +0000 Subject: [PATCH] Add ARCHFLAGS workaround for building universal2 on macOS 10.15 --- cibuildwheel/macos.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index f628892c..42c76251 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -253,6 +253,11 @@ def setup_python(python_configuration: PythonConfiguration, # have that as a minimum. env.setdefault('_PYTHON_HOST_PLATFORM', 'macosx-11.0-arm64') env.setdefault('ARCHFLAGS', '-arch arm64') + elif python_configuration.identifier.endswith('universal2'): + if get_macos_version() < (10, 16): + # we can do universal2 builds on macos 10.15, but we need to + # set ARCHFLAGS otherwise CPython sets it to `-arch x86_64` + env.setdefault('ARCHFLAGS', '-arch arm64 -arch x86_64') if python_configuration.identifier.endswith('_arm64') or python_configuration.identifier.endswith('_universal2'): if get_macos_version() < (10, 16):