Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions foreign_cc/private/transitions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ load("@rules_cc//cc:defs.bzl", "CcInfo")
load("//foreign_cc:providers.bzl", "ForeignCcDepsInfo")

def _extra_toolchains_transition_impl(settings, attrs):
return {"//command_line_option:extra_toolchains": [attrs.extra_toolchain] + settings["//command_line_option:extra_toolchains"]}
t = getattr(attrs, "extra_toolchain", None)
if not t:
return {}

return {"//command_line_option:extra_toolchains": [t] + settings["//command_line_option:extra_toolchains"]}

_extra_toolchains_transition = transition(
implementation = _extra_toolchains_transition_impl,
Expand All @@ -29,7 +33,6 @@ extra_toolchains_transitioned_foreign_cc_target = rule(
# This attr is singular to make it selectable when used for add make toolchain variant.
"extra_toolchain": attr.label(
doc = "Additional toolchain to consider. Note, this is singular.",
mandatory = True,
),
"target": attr.label(
doc = "The target to build after considering the extra toolchains",
Expand Down