Skip to content

Commit a9de873

Browse files
committed
setup: Assume non-universal devkit build on macOS
The setuptools build system typically builds a universal binary, but that requires downloading multiple devkits and combining them. The user may still elect to do that by setting _PYTHON_HOST_PLATFORM, but by default we assume that a non-universal build is desired.
1 parent 2d933bc commit a9de873

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ def build_extension(self, ext):
6363
"-Wl,-exported_symbol,_PyInit__frida",
6464
"-Wl,-dead_strip",
6565
]
66+
if "_PYTHON_HOST_PLATFORM" not in os.environ:
67+
if platform.machine() == "arm64":
68+
host_arch = "arm64"
69+
macos_req = "11.0"
70+
else:
71+
host_arch = "x86_64"
72+
macos_req = "10.9"
73+
os.environ["_PYTHON_HOST_PLATFORM"] = f"macosx-{macos_req}-{host_arch}"
74+
os.environ["ARCHFLAGS"] = f"-arch {host_arch}"
75+
os.environ["MACOSX_DEPLOYMENT_TARGET"] = macos_req
6676
else:
6777
version_script = os.path.join(package_dir, "src", "_frida.version")
6878
if not os.path.exists(version_script):

0 commit comments

Comments
 (0)