Skip to content

Commit

Permalink
Prefer target cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Nov 17, 2021
1 parent 25131e2 commit d35cf2f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apple/internal/transition_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ def _cpu_string(platform_type, settings):
cpu_value = settings["//command_line_option:cpu"]
if cpu_value.startswith("ios_"):
return cpu_value
if cpu_value == "darwin_arm64"
return "ios_sim_arm64"
return "ios_x86_64"
if platform_type == "macos":
macos_cpus = settings["//command_line_option:macos_cpus"]
if macos_cpus:
return "darwin_{}".format(macos_cpus[0])
return settings["//command_line_option:host_cpu"]
cpu_value = settings["//command_line_option:cpu"]
if cpu_value.startswith("darwin_"):
return cpu_value
return "darwin_x86_64"
if platform_type == "tvos":
tvos_cpus = settings["//command_line_option:tvos_cpus"]
if tvos_cpus:
Expand Down Expand Up @@ -77,7 +82,6 @@ _apple_rule_base_transition_inputs = [
"//command_line_option:apple_crosstool_top",
"//command_line_option:apple_grte_top",
"//command_line_option:cpu",
"//command_line_option:host_cpu",
"//command_line_option:ios_multi_cpus",
"//command_line_option:macos_cpus",
"//command_line_option:tvos_cpus",
Expand Down

0 comments on commit d35cf2f

Please sign in to comment.