xref: /aosp_15_r20/external/bazelbuild-rules_rust/bindgen/3rdparty/BUILD.bazel (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1*d4726bddSHONG Yifanload("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2*d4726bddSHONG Yifanload("//bindgen:repositories.bzl", "BINDGEN_VERSION")
3*d4726bddSHONG Yifanload("//crate_universe:defs.bzl", "crate", "crates_vendor")
4*d4726bddSHONG Yifan
5*d4726bddSHONG Yifan_BINDGEN_CLI_PACKAGES = {
6*d4726bddSHONG Yifan    "clap": crate.spec(
7*d4726bddSHONG Yifan        version = "4.3.3",
8*d4726bddSHONG Yifan    ),
9*d4726bddSHONG Yifan    "clap_complete": crate.spec(
10*d4726bddSHONG Yifan        version = "4.3.1",
11*d4726bddSHONG Yifan    ),
12*d4726bddSHONG Yifan    "env_logger": crate.spec(
13*d4726bddSHONG Yifan        version = "0.10.0",
14*d4726bddSHONG Yifan    ),
15*d4726bddSHONG Yifan}
16*d4726bddSHONG Yifan
17*d4726bddSHONG Yifancrates_vendor(
18*d4726bddSHONG Yifan    name = "crates_vendor",
19*d4726bddSHONG Yifan    annotations = {
20*d4726bddSHONG Yifan        "bindgen": [crate.annotation(
21*d4726bddSHONG Yifan            gen_build_script = True,
22*d4726bddSHONG Yifan        )],
23*d4726bddSHONG Yifan        "clang-sys": [crate.annotation(
24*d4726bddSHONG Yifan            gen_build_script = True,
25*d4726bddSHONG Yifan        )],
26*d4726bddSHONG Yifan        "libc": [crate.annotation(
27*d4726bddSHONG Yifan            gen_build_script = True,
28*d4726bddSHONG Yifan        )],
29*d4726bddSHONG Yifan        "rustix": [crate.annotation(
30*d4726bddSHONG Yifan            gen_build_script = True,
31*d4726bddSHONG Yifan        )],
32*d4726bddSHONG Yifan        "winapi": [crate.annotation(
33*d4726bddSHONG Yifan            gen_build_script = True,
34*d4726bddSHONG Yifan        )],
35*d4726bddSHONG Yifan    },
36*d4726bddSHONG Yifan    cargo_lockfile = "Cargo.Bazel.lock",
37*d4726bddSHONG Yifan    generate_build_scripts = False,
38*d4726bddSHONG Yifan    mode = "remote",
39*d4726bddSHONG Yifan    packages = dict({
40*d4726bddSHONG Yifan        "bindgen": crate.spec(
41*d4726bddSHONG Yifan            default_features = False,
42*d4726bddSHONG Yifan            features = ["runtime"],
43*d4726bddSHONG Yifan            version = BINDGEN_VERSION,
44*d4726bddSHONG Yifan        ),
45*d4726bddSHONG Yifan        "bindgen-cli": crate.spec(
46*d4726bddSHONG Yifan            default_features = False,
47*d4726bddSHONG Yifan            features = ["runtime"],
48*d4726bddSHONG Yifan            version = BINDGEN_VERSION,
49*d4726bddSHONG Yifan        ),
50*d4726bddSHONG Yifan        "clang-sys": crate.spec(
51*d4726bddSHONG Yifan            # Should match the version of llvm-project being used.
52*d4726bddSHONG Yifan            features = ["clang_14_0"],
53*d4726bddSHONG Yifan            version = "1.6.1",
54*d4726bddSHONG Yifan        ),
55*d4726bddSHONG Yifan    }.items() + _BINDGEN_CLI_PACKAGES.items()),
56*d4726bddSHONG Yifan    repository_name = "rules_rust_bindgen",
57*d4726bddSHONG Yifan    tags = ["manual"],
58*d4726bddSHONG Yifan)
59*d4726bddSHONG Yifan
60*d4726bddSHONG Yifanalias(
61*d4726bddSHONG Yifan    name = "bindgen",
62*d4726bddSHONG Yifan    actual = "@rules_rust_bindgen__bindgen-cli-{}//:bindgen-cli".format(BINDGEN_VERSION),
63*d4726bddSHONG Yifan    tags = ["manual"],
64*d4726bddSHONG Yifan    visibility = ["//visibility:public"],
65*d4726bddSHONG Yifan)
66*d4726bddSHONG Yifan
67*d4726bddSHONG Yifanbzl_library(
68*d4726bddSHONG Yifan    name = "bzl_lib",
69*d4726bddSHONG Yifan    srcs = [
70*d4726bddSHONG Yifan        "//bindgen/3rdparty/crates:crates.bzl",
71*d4726bddSHONG Yifan        "//bindgen/3rdparty/crates:defs.bzl",
72*d4726bddSHONG Yifan    ],
73*d4726bddSHONG Yifan    visibility = ["//bindgen:__pkg__"],
74*d4726bddSHONG Yifan)
75