aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tools/build_defs/apple/shared.bzl8
-rw-r--r--tools/build_defs/apple/swift.bzl12
2 files changed, 5 insertions, 15 deletions
diff --git a/tools/build_defs/apple/shared.bzl b/tools/build_defs/apple/shared.bzl
index 05d96ceb91..97c567f18a 100644
--- a/tools/build_defs/apple/shared.bzl
+++ b/tools/build_defs/apple/shared.bzl
@@ -65,12 +65,8 @@ def xcrun_action(ctx, **kw):
This method takes the same keyword arguments as ctx.action, however you don't
need to specify the executable.
"""
- if hasattr(ctx.fragments.apple, "single_arch_platform"):
- platform = ctx.fragments.apple.single_arch_platform
- else:
- # TODO(dmishe): Remove this branch when single_arch_platform is available
- # by default.
- platform = ctx.fragments.apple.ios_cpu_platform()
+ # TODO(dmishe): Use single_arch_platform() when available.
+ platform = ctx.fragments.apple.ios_cpu_platform()
action_env = ctx.fragments.apple.target_apple_env(platform) \
+ ctx.fragments.apple.apple_host_system_env()
diff --git a/tools/build_defs/apple/swift.bzl b/tools/build_defs/apple/swift.bzl
index 4a6f443518..1a315a1930 100644
--- a/tools/build_defs/apple/swift.bzl
+++ b/tools/build_defs/apple/swift.bzl
@@ -72,15 +72,9 @@ def _swift_library_impl(ctx):
# TODO(b/29772303): Assert xcode version.
apple_fm = ctx.fragments.apple
- if (hasattr(apple_fm, "single_arch_platform")
- and hasattr(apple_fm, "single_arch_cpu")):
- cpu = apple_fm.single_arch_cpu
- platform = apple_fm.single_arch_platform
- else:
- # TODO(dmishe): Remove this branch when single_arch_platform is available
- # by default.
- cpu = apple_fm.ios_cpu()
- platform = apple_fm.ios_cpu_platform()
+ # TODO(dmishe): Use single_arch_cpu and single_arch_platform when available.
+ cpu = apple_fm.ios_cpu()
+ platform = apple_fm.ios_cpu_platform()
sdk_version = apple_fm.sdk_version_for_platform(platform)
target = _swift_target(cpu, platform, sdk_version)