// TODO(bazel-team): Use the value from --watchos-minimum-os instead of tying to the SDK
// version.
private List<String> commonLinkAndCompileFlagsForClang(
      ObjcProvider provider, ObjcConfiguration objcConfiguration,
      AppleConfiguration appleConfiguration) {
    ImmutableList.Builder<String> builder = new ImmutableList.Builder<>();
    Platform platform = appleConfiguration.getSingleArchPlatform();
    switch (platform) {
      case IOS_SIMULATOR:
        builder.add("-mios-simulator-version-min="
            + appleConfiguration.getMinimumOsForPlatformType(platform.getType()));
        break;
      case IOS_DEVICE:
        builder.add("-miphoneos-version-min="
            + appleConfiguration.getMinimumOsForPlatformType(platform.getType()));
        break;
      case WATCHOS_SIMULATOR:
        // TODO(bazel-team): Use the value from --watchos-minimum-os instead of tying to the SDK
        // version.
        builder.add("-mwatchos-simulator-version-min="
            + appleConfiguration.getSdkVersionForPlatform(platform));
        break;
      case WATCHOS_DEVICE:
        // TODO(bazel-team): Use the value from --watchos-minimum-os instead of tying to the SDK
        // version.
        builder.add("-mwatchos-version-min="
            + appleConfiguration.getSdkVersionForPlatform(platform));
        break;
      case TVOS_SIMULATOR:
        builder.add("-mtvos-simulator-version-min="
            + appleConfiguration.getMinimumOsForPlatformType(platform.getType()));
        break;
      case TVOS_DEVICE:
        builder.add("-mtvos-version-min="
            + appleConfiguration.getMinimumOsForPlatformType(platform.getType()));
        break;
      default:
        throw new IllegalArgumentException("Unhandled platform " + platform);
    }
    if (objcConfiguration.generateDsym()) {
      builder.add("-g");
    }
    return builder
        .add("-arch", appleConfiguration.getSingleArchitecture())
        .add("-isysroot", AppleToolchain.sdkDir())
        // TODO(bazel-team): Pass framework search paths to Xcodegen.
        .addAll(commonFrameworkFlags(provider, appleConfiguration))
        .build();
  }
break;
case WATCHOS_SIMULATOR:
// TODO(bazel-team): Use the value from --watchos-minimum-os instead of tying to the SDK
// version.
builder.add("-mwatchos-simulator-version-min="
+ appleConfiguration.getSdkVersionForPlatform(platform));
switch (platform) {
case IOS_SIMULATOR:
builder.add("-mios-simulator-version-min="
+ appleConfiguration.getMinimumOsForPlatformType(platform.getType()));
break;
case IOS_DEVICE:
builder.add("-miphoneos-version-min="
+ appleConfiguration.getMinimumOsForPlatformType(platform.getType()));
break;
case WATCHOS_SIMULATOR:
// TODO(bazel-team): Use the value from --watchos-minimum-os instead of tying to the SDK
// version.
builder.add("-mwatchos-simulator-version-min="
+ appleConfiguration.getSdkVersionForPlatform(platform));
break;
case WATCHOS_DEVICE:
// TODO(bazel-team): Use the value from --watchos-minimum-os instead of tying to the SDK
// version.
builder.add("-mwatchos-version-min="
+ appleConfiguration.getSdkVersionForPlatform(platform));
break;
case TVOS_SIMULATOR:
private List<String> commonLinkAndCompileFlagsForClang(
ObjcProvider provider, ObjcConfiguration objcConfiguration,
AppleConfiguration appleConfiguration) {
ImmutableList.Builder<String> builder = new ImmutableList.Builder<>();
Platform platform = appleConfiguration.getSingleArchPlatform();
switch (platform) {
case IOS_SIMULATOR:
builder.add("-mios-simulator-version-min="
+ appleConfiguration.getMinimumOsForPlatformType(platform.getType()));
break;
case IOS_DEVICE:
builder.add("-miphoneos-version-min="
+ appleConfiguration.getMinimumOsForPlatformType(platform.getType()));
break;
case WATCHOS_SIMULATOR:
// TODO(bazel-team): Use the value from --watchos-minimum-os instead of tying to the SDK
// version.
builder.add("-mwatchos-simulator-version-min="
+ appleConfiguration.getSdkVersionForPlatform(platform));
break;
case WATCHOS_DEVICE:
// TODO(bazel-team): Use the value from --watchos-minimum-os instead of tying to the SDK
// version.
builder.add("-mwatchos-version-min="
+ appleConfiguration.getSdkVersionForPlatform(platform));
break;
case TVOS_SIMULATOR:
builder.add("-mtvos-simulator-version-min="
+ appleConfiguration.getMinimumOsForPlatformType(platform.getType()));
break;
case TVOS_DEVICE:
builder.add("-mtvos-version-min="
+ appleConfiguration.getMinimumOsForPlatformType(platform.getType()));
break;
default:
throw new IllegalArgumentException("Unhandled platform " + platform);
}