# Part of the Crubit project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

"""Crubit (rs_bindings_from_cc) toolchain."""

load(
    "@@//rs_bindings_from_cc/bazel_support:providers.bzl",
    "RustBindingsFromCcToolchainInfo",
)

def _rs_bindings_from_cc_toolchain_impl(ctx):
    return [
        platform_common.ToolchainInfo(
            rs_bindings_from_cc_toolchain_info = RustBindingsFromCcToolchainInfo(
                binary = ctx.file.binary,
                is_on_demand = ctx.attr.is_on_demand,
            ),
        ),
    ]

rs_bindings_from_cc_toolchain = rule(
    implementation = _rs_bindings_from_cc_toolchain_impl,
    attrs = {
        "binary": attr.label(
            executable = True,
            allow_single_file = True,
            cfg = "exec",
        ),
        "is_on_demand": attr.bool(),
    },
)
