Add a helper function for rules that need the CC toolchain #14728
Labels
P1
I'll work on this now. (Assignee required)
team-Rules-CPP
Issues for C++ rules
type: feature request
Currently, rules that require the CC toolchain via toolchain resolution use this syntax:
(Possibly with other toolchain types present)
With optional toolchains, the syntax is changing, and will wait on a Bazel release.
We should provide a simple helper function that rules can use to be forward compatible when the new optional toolchains are release:
The implemenation of
use_cpp_toolchain
will update with Bazel and will either return the bare-string toolchain type (as used currently) or the more complicatedconfig.toolchain_type
call. Rules won't need to make changes (beyond changing the value ofmandatory
if desired).The only parameter will be
mandatory
, which will default toTrue
for backwards compatibility.The text was updated successfully, but these errors were encountered: