[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / utils / bazel / llvm-project-overlay / llvm / binary_alias.bzl
blob0108742f345edaabf71d1ad1a66e561e7946b54a
1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 """Creates a copy of a binary, giving it a different basename.
7 binary_alias(
8     name = "my_binary_other_name",
9     binary = ":some_cc_binary",
11 """
13 def _binary_alias_impl(ctx):
14     ctx.actions.symlink(
15         target_file = ctx.executable.binary,
16         output = ctx.outputs.executable,
17         is_executable = True,
18     )
20     return [DefaultInfo(
21         executable = ctx.outputs.executable,
22         runfiles = ctx.attr.binary[DefaultInfo].default_runfiles,
23     )]
25 binary_alias = rule(
26     _binary_alias_impl,
27     attrs = {
28         "binary": attr.label(
29             mandatory = True,
30             executable = True,
31             cfg = "target",
32         ),
33     },
34     executable = True,