Skip to content

Commit

Permalink
Infer CPUs for tvOS and watchOS when on Apple Silicon
Browse files Browse the repository at this point in the history
This PR contains the same logical change as bazelbuild@aaae8ce but for watchOS and tvOS. When on Apple Silicon, we should build for the right CPU architecture. This is `sim_arm64` for tvOS and `arm64` for watchOS.

On a separate note, I'm not sure if `i386` should be the default architecture for watchOS anymore. I'm happy to change that to `x86_64` to align with all the other platforms if people agree.

Closes bazelbuild#16547.

PiperOrigin-RevId: 483997916
Change-Id: I67b7f2e2edac5184787f3c3511dc49bb4aeef108
  • Loading branch information
BalestraPatrick authored and Copybara-Service committed Oct 26, 2022
1 parent a82d26f commit b098434
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,12 @@ public class AppleCommandLineOptions extends FragmentOptions {
@VisibleForTesting static final String DEFAULT_IOS_CPU = "x86_64";

/** The default watchos CPU value. */
public static final String DEFAULT_WATCHOS_CPU = "i386";
public static final String DEFAULT_WATCHOS_CPU =
CPU.getCurrent() == CPU.AARCH64 ? "arm64" : "i386";

/** The default tvOS CPU value. */
public static final String DEFAULT_TVOS_CPU = "x86_64";
public static final String DEFAULT_TVOS_CPU =
CPU.getCurrent() == CPU.AARCH64 ? "sim_arm64" : "x86_64";

/** The default macOS CPU value. */
public static final String DEFAULT_MACOS_CPU =
Expand Down

0 comments on commit b098434

Please sign in to comment.