Skip to content

Commit 3a1d305

Browse files
Merge pull request #230 from hlopko:migrate_cc_toolchains_platforms
PiperOrigin-RevId: 248344422
2 parents bfc291e + ceb80a7 commit 3a1d305

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

swift/internal/swift_toolchain.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def _run_swift_action(toolchain_tools, swift_wrapper, actions, **kwargs):
176176
def _swift_toolchain_impl(ctx):
177177
toolchain_root = ctx.attr.root
178178
cc_toolchain = find_cpp_toolchain(ctx)
179-
cc_toolchain_files = ctx.attr._cc_toolchain.files
179+
cc_toolchain_files = cc_toolchain.all_files
180180

181181
linker_opts_producer = partial.make(
182182
_default_linker_opts,
@@ -274,5 +274,6 @@ The C++ toolchain from which other tools needed by the Swift toolchain (such as
274274
}),
275275
doc = "Represents a Swift compiler toolchain.",
276276
fragments = ["swift"],
277+
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
277278
implementation = _swift_toolchain_impl,
278279
)

swift/internal/xcode_swift_toolchain.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def _xcode_swift_toolchain_impl(ctx):
506506
)
507507

508508
cc_toolchain = find_cpp_toolchain(ctx)
509-
cc_toolchain_files = ctx.attr._cc_toolchain.files
509+
cc_toolchain_files = cc_toolchain.all_files
510510

511511
# Compute the default requested features and conditional ones based on Xcode version.
512512
requested_features = features_for_build_modes(ctx, objc_fragment = ctx.fragments.objc)
@@ -587,5 +587,6 @@ The C++ toolchain from which linking flags and other tools needed by the Swift t
587587
"objc",
588588
"swift",
589589
],
590+
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
590591
implementation = _xcode_swift_toolchain_impl,
591592
)

0 commit comments

Comments
 (0)