summaryrefslogtreecommitdiff
path: root/buildlibxml.py
diff options
context:
space:
mode:
authorQuentin Leffray <fiahil@gmail.com>2022-11-07 10:27:54 +0100
committerGitHub <noreply@github.com>2022-11-07 10:27:54 +0100
commit1f1927fd618cae32e010c8c303dc9c44a319de1c (patch)
tree4afd1c6677f7c0333d5525a4c01e939208800e95 /buildlibxml.py
parent77413c28e237f3f4bf2363150aaab9d2f7705f7b (diff)
downloadpython-lxml-1f1927fd618cae32e010c8c303dc9c44a319de1c.tar.gz
Provide the correct C compiler configuration for local wheel building on ARM Mac (GH-359)
Diffstat (limited to 'buildlibxml.py')
-rw-r--r--buildlibxml.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/buildlibxml.py b/buildlibxml.py
index 8a7504eb..8faf5937 100644
--- a/buildlibxml.py
+++ b/buildlibxml.py
@@ -416,11 +416,18 @@ def configure_darwin_env(env_setup):
# configure target architectures on MacOS-X (x86_64 only, by default)
major_version, minor_version = tuple(map(int, platform.mac_ver()[0].split('.')[:2]))
if major_version > 7:
- env_default = {
- 'CFLAGS': "-arch x86_64 -O2",
- 'LDFLAGS': "-arch x86_64",
- 'MACOSX_DEPLOYMENT_TARGET': "10.6"
- }
+ if platform.mac_ver()[2] == "arm64":
+ env_default = {
+ 'CFLAGS': "-arch arm64 -O2",
+ 'LDFLAGS': "-arch arm64",
+ 'MACOSX_DEPLOYMENT_TARGET': "10.6"
+ }
+ else:
+ env_default = {
+ 'CFLAGS': "-arch x86_64 -O2",
+ 'LDFLAGS': "-arch x86_64",
+ 'MACOSX_DEPLOYMENT_TARGET': "10.6"
+ }
env_default.update(os.environ)
env_setup['env'] = env_default