Skip to content

Commit ddb3818

Browse files
committed
Add arm64/x86_64 CFLAGS+LDFLAGS on macOS wheel builds.
1 parent 76f84ea commit ddb3818

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@
5454
"-DCYTHON_TRACE_NOGIL=1",
5555
]
5656

57+
if sys.platform == "darwin":
58+
try:
59+
if int(os.environ.get("MACOSX_DEPLOYMENT_TARGET", "0").split(".", 1)[0]) >= 11:
60+
if "-arch" not in os.environ.get("CFLAGS", ""):
61+
os.environ["CFLAGS"] += " -arch arm64 -arch x86_64"
62+
os.environ["LDFLAGS"] += " -arch arm64 -arch x86_64"
63+
except ValueError:
64+
pass # probably cannot parse "MACOSX_DEPLOYMENT_TARGET"
65+
5766

5867
with open('src/quicktions.pyx') as f:
5968
version = re.search("__version__\s*=\s*'([^']+)'", f.read(2048)).group(1)

0 commit comments

Comments
 (0)