Skip to content

Commit b098434

Browse files
BalestraPatrickcopybara-github
authored andcommitted
Infer CPUs for tvOS and watchOS when on Apple Silicon
This PR contains the same logical change as 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 #16547. PiperOrigin-RevId: 483997916 Change-Id: I67b7f2e2edac5184787f3c3511dc49bb4aeef108
1 parent a82d26f commit b098434

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/com/google/devtools/build/lib/rules/apple/AppleCommandLineOptions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,12 @@ public class AppleCommandLineOptions extends FragmentOptions {
193193
@VisibleForTesting static final String DEFAULT_IOS_CPU = "x86_64";
194194

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

198199
/** The default tvOS CPU value. */
199-
public static final String DEFAULT_TVOS_CPU = "x86_64";
200+
public static final String DEFAULT_TVOS_CPU =
201+
CPU.getCurrent() == CPU.AARCH64 ? "sim_arm64" : "x86_64";
200202

201203
/** The default macOS CPU value. */
202204
public static final String DEFAULT_MACOS_CPU =

0 commit comments

Comments
 (0)