diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6921950..ada133c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -92,6 +92,7 @@ jobs: CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_24" CIBW_TEST_EXTRAS: "tests" CIBW_TEST_COMMAND: nosetests {project}/tests -d + CIBW_TEST_SKIP: "*-macosx_arm64" - name: Upload Wheels uses: actions/upload-artifact@v2 diff --git a/setup.py b/setup.py index 859cae2..434978a 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ import os +import re import sys import glob import subprocess @@ -84,6 +85,12 @@ class CMakeBuild(build_ext): ] build_args += ["--config", cfg] + if sys.platform.startswith("darwin"): + # Cross-compile support for macOS - respect ARCHFLAGS if set + archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", "")) + if archs: + cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))] + # Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level # across all generators. if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: