blob: 598746eb817ff3467cac28f7d4434dcfb8c2ca2a [file] [log] [blame]
Brian Silvermancc09f182022-03-09 15:40:20 -08001load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2load("//rust:defs.bzl", "capture_clippy_output", "error_format", "extra_exec_rustc_flags", "extra_rustc_flags")
3
4exports_files(["LICENSE"])
5
6bzl_library(
7 name = "bzl_lib",
8 srcs = [
9 ":workspace.bzl",
10 ],
11 visibility = ["//visibility:public"],
12)
13
14alias(
15 name = "rules",
16 actual = ":bzl_lib",
17 deprecation = "Please use the `@rules_rust//:bzl_lib` target instead",
18 visibility = ["//visibility:public"],
19)
20
21# This setting may be changed from the command line to generate machine readable errors.
22error_format(
23 name = "error_format",
24 build_setting_default = "human",
25 visibility = ["//visibility:public"],
26)
27
28# This setting may be used to pass extra options to rustc from the command line
29# in non-exec configuration.
30# It applies across all targets whereas the rustc_flags option on targets applies only
31# to that target. This can be useful for passing build-wide options such as LTO.
32extra_rustc_flags(
33 name = "extra_rustc_flags",
34 build_setting_default = [],
35 visibility = ["//visibility:public"],
36)
37
38# This setting may be used to pass extra options to rustc from the command line
39# in exec configuration.
40# It applies across all targets whereas the rustc_flags option on targets applies only
41# to that target. This can be useful for passing build-wide options such as LTO.
42extra_exec_rustc_flags(
43 name = "extra_exec_rustc_flags",
44 build_setting_default = [],
45 visibility = ["//visibility:public"],
46)
47
48# This setting is used by the clippy rules. See https://bazelbuild.github.io/rules_rust/rust_clippy.html
49label_flag(
50 name = "clippy.toml",
51 build_setting_default = "//tools/clippy:clippy.toml",
52 visibility = ["//visibility:public"],
53)
54
55# This setting is used by the rustfmt rules. See https://bazelbuild.github.io/rules_rust/rust_fmt.html
56label_flag(
57 name = "rustfmt.toml",
58 build_setting_default = "//tools/rustfmt:rustfmt.toml",
59 visibility = ["//visibility:public"],
60)
61
62alias(
63 name = "rustfmt",
64 actual = "//tools/rustfmt",
65 visibility = ["//visibility:public"],
66)
67
68capture_clippy_output(
69 name = "capture_clippy_output",
70 build_setting_default = False,
71 visibility = ["//visibility:public"],
72)