Skip to content

Commit fde1e85

Browse files
Merge pull request #2790 from AlexanderViand:darwin_x86_64
PiperOrigin-RevId: 886386050
2 parents eaec4d5 + 230284e commit fde1e85

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ archs = "auto64"
9090
[tool.cibuildwheel.macos]
9191
# Inherits archs from default (auto64)
9292
# Unused by Bazel, but needed explicitly by delocate on MacOS.
93-
environment = { MACOSX_DEPLOYMENT_TARGET = "10.14" }
93+
environment = { MACOSX_DEPLOYMENT_TARGET = "10.15" }
9494

9595
[tool.pytest.ini_options]
9696
norecursedirs = [

setup.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,18 @@ def bazel_build(self, ext: BazelExtension) -> None: # noqa: C901
243243
# C++17 needs macOS 10.14 at minimum
244244
bazel_argv.append("--macos_minimum_os=10.15")
245245

246+
# Cross-compilation support: detect target arch from ARCHFLAGS (set by cibuildwheel).
247+
archflags = os.environ.get("ARCHFLAGS", "")
248+
if "x86_64" in archflags:
249+
target_arch = "x86_64"
250+
elif "arm64" in archflags:
251+
target_arch = "arm64"
252+
else:
253+
target_arch = platform.machine()
254+
bazel_argv.append(
255+
f"--platforms=@build_bazel_apple_support//platforms:darwin_{target_arch}"
256+
)
257+
246258
with _maybe_patch_toolchains():
247259
self.spawn(bazel_argv)
248260

0 commit comments

Comments
 (0)