Skip to content

Commit

Permalink
Merge pull request #244 from keith:ks/allow-extra-args-to-cc_sysroot
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 682280945
Change-Id: I1f0256f6c99dd1e67efdcd08145700e10ab26e6a
  • Loading branch information
copybara-github committed Oct 4, 2024
2 parents 565dbd6 + b4f54fa commit 7343c66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cc/toolchains/args/sysroot.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ load("//cc/toolchains:args.bzl", "cc_args")

visibility("public")

def cc_sysroot(name, sysroot, **kwargs):
def cc_sysroot(name, sysroot, args = [], **kwargs):
"""Creates args for a sysroot.
Args:
name: (str) The name of the target
sysroot: (bazel_skylib's directory rule) The directory that should be the
sysroot.
args: (List[str]) Extra command-line args to add.
**kwargs: kwargs to pass to cc_args.
"""
cc_args(
Expand All @@ -33,7 +34,7 @@ def cc_sysroot(name, sysroot, **kwargs):
Label("//cc/toolchains/actions:c_compile"),
Label("//cc/toolchains/actions:link_actions"),
],
args = ["--sysroot={sysroot}"],
args = ["--sysroot={sysroot}"] + args,
format = {"sysroot": sysroot},
**kwargs
)

0 comments on commit 7343c66

Please sign in to comment.