Skip to content

Commit

Permalink
Update DEFAULT_IOS_CPU for M1 arm64 simulator support
Browse files Browse the repository at this point in the history
Now that bazel supports ios_sim_arm64 we can prefer this if no other iOS
CPU is passed so that developers can build the simulator builds of their
apps / tests without having to pass a flag depending on the host.

Closes bazelbuild#13873.

PiperOrigin-RevId: 405661296
  • Loading branch information
keith authored and Copybara-Service committed Oct 26, 2021
1 parent 276aef3 commit d7628e1
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -34,6 +34,7 @@
import com.google.devtools.build.lib.rules.apple.AppleCommandLineOptions.AppleBitcodeMode;
import com.google.devtools.build.lib.rules.apple.ApplePlatform.PlatformType;
import com.google.devtools.build.lib.starlarkbuildapi.apple.AppleConfigurationApi;
import com.google.devtools.build.lib.util.CPU;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
Expand Down Expand Up @@ -77,7 +78,8 @@ public class AppleConfiguration extends Fragment implements AppleConfigurationAp
public static final String IOS_FORCED_SIMULATOR_CPU_PREFIX = "sim_";

/** Default cpu for iOS builds. */
@VisibleForTesting static final String DEFAULT_IOS_CPU = "x86_64";
@VisibleForTesting
static final String DEFAULT_IOS_CPU = CPU.getCurrent() == CPU.AARCH64 ? "sim_arm64" : "x86_64";

private final PlatformType applePlatformType;
private final ConfigurationDistinguisher configurationDistinguisher;
Expand Down

0 comments on commit d7628e1

Please sign in to comment.