mirror of
https://github.com/drewcassidy/quicktex.git
synced 2024-09-13 06:37:34 +00:00
Enable macos cross-compiling in setup.py
This commit is contained in:
parent
e488dbcbff
commit
d1346ca11d
1
.github/workflows/python-package.yml
vendored
1
.github/workflows/python-package.yml
vendored
@ -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
|
||||
|
7
setup.py
7
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:
|
||||
|
Loading…
Reference in New Issue
Block a user