We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15156d1 commit e7d2cd8Copy full SHA for e7d2cd8
setup.py
@@ -1,5 +1,6 @@
1
# -*- coding: utf-8 -*-
2
import os
3
+import re
4
import sys
5
import subprocess
6
@@ -49,6 +50,12 @@ def build_extension(self, ext):
49
50
]
51
build_args += ["--config", cfg]
52
53
+ if sys.platform.startswith("darwin"):
54
+ # Cross-compile support for macOS - respect ARCHFLAGS if set
55
+ archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", ""))
56
+ if archs:
57
+ cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))]
58
+
59
# Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level
60
# across all generators.
61
if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ:
0 commit comments