Skip to content

Commit

Permalink
Add platforms to apple_universal_binary transition (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
comius authored Sep 19, 2023
1 parent cb8d872 commit 17f1dae
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/transitions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ def _macos_universal_transition_impl(settings, _attr):
# Create a split transition from any macOS cpu to a list of all macOS cpus
if settings["//command_line_option:cpu"].startswith("darwin"):
return [
{"//command_line_option:cpu": "darwin_x86_64"},
{"//command_line_option:cpu": "darwin_arm64"},
{
"//command_line_option:cpu": "darwin_arm64",
"//command_line_option:platforms": "//platforms:macos_arm64",
},
{
"//command_line_option:cpu": "darwin_x86_64",
"//command_line_option:platforms": "//platforms:macos_x86_64",
},
]
else:
return settings

macos_universal_transition = transition(
implementation = _macos_universal_transition_impl,
inputs = ["//command_line_option:cpu"],
outputs = ["//command_line_option:cpu"],
outputs = ["//command_line_option:cpu", "//command_line_option:platforms"],
)

0 comments on commit 17f1dae

Please sign in to comment.