blob: 69e43c7e9143876c6ac334e9c06c720a212e8fd6 [file] [log] [blame]
Brian Silvermancc09f182022-03-09 15:40:20 -08001load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
Brian Silverman5f6f2762022-08-13 19:30:05 -07002load("//rust:defs.bzl", "capture_clippy_output", "clippy_flags", "error_format", "extra_exec_rustc_flag", "extra_exec_rustc_flags", "extra_rustc_flag", "extra_rustc_flags", "is_proc_macro_dep", "is_proc_macro_dep_enabled")
Brian Silvermancc09f182022-03-09 15:40:20 -08003
4exports_files(["LICENSE"])
5
6bzl_library(
7 name = "bzl_lib",
8 srcs = [
9 ":workspace.bzl",
10 ],
11 visibility = ["//visibility:public"],
12)
13
Brian Silvermancc09f182022-03-09 15:40:20 -080014# This setting may be changed from the command line to generate machine readable errors.
15error_format(
16 name = "error_format",
17 build_setting_default = "human",
18 visibility = ["//visibility:public"],
19)
20
Brian Silverman5f6f2762022-08-13 19:30:05 -070021# This setting may be used to pass extra options to clippy from the command line.
22# It applies across all targets.
23clippy_flags(
24 name = "clippy_flags",
25 build_setting_default = [],
26 visibility = ["//visibility:public"],
27)
28
29# This setting may be used to identify dependencies of proc-macro-s.
30# This feature is only enabled if `is_proc_macro_dep_enabled` is true.
31# Its value controls the BAZEL_RULES_RUST_IS_PROC_MACRO_DEP environment variable
32# made available to the rustc invocation.
33is_proc_macro_dep(
34 name = "is_proc_macro_dep",
35 build_setting_default = False,
36 visibility = ["//visibility:public"],
37)
38
39# This setting enables the feature to identify dependencies of proc-macro-s,
40# see `is_proc_macro_dep`.
41is_proc_macro_dep_enabled(
42 name = "is_proc_macro_dep_enabled",
43 build_setting_default = False,
44 visibility = ["//visibility:public"],
45)
46
Brian Silvermancc09f182022-03-09 15:40:20 -080047# This setting may be used to pass extra options to rustc from the command line
48# in non-exec configuration.
49# It applies across all targets whereas the rustc_flags option on targets applies only
50# to that target. This can be useful for passing build-wide options such as LTO.
51extra_rustc_flags(
52 name = "extra_rustc_flags",
53 build_setting_default = [],
54 visibility = ["//visibility:public"],
55)
56
Brian Silverman5f6f2762022-08-13 19:30:05 -070057extra_rustc_flag(
58 name = "extra_rustc_flag",
59 build_setting_default = "",
60 visibility = ["//visibility:public"],
61)
62
Brian Silvermancc09f182022-03-09 15:40:20 -080063# This setting may be used to pass extra options to rustc from the command line
64# in exec configuration.
65# It applies across all targets whereas the rustc_flags option on targets applies only
66# to that target. This can be useful for passing build-wide options such as LTO.
67extra_exec_rustc_flags(
68 name = "extra_exec_rustc_flags",
69 build_setting_default = [],
70 visibility = ["//visibility:public"],
71)
72
Brian Silverman5f6f2762022-08-13 19:30:05 -070073extra_exec_rustc_flag(
74 name = "extra_exec_rustc_flag",
75 build_setting_default = "",
76 visibility = ["//visibility:public"],
77)
78
Brian Silvermancc09f182022-03-09 15:40:20 -080079# This setting is used by the clippy rules. See https://bazelbuild.github.io/rules_rust/rust_clippy.html
80label_flag(
81 name = "clippy.toml",
82 build_setting_default = "//tools/clippy:clippy.toml",
83 visibility = ["//visibility:public"],
84)
85
86# This setting is used by the rustfmt rules. See https://bazelbuild.github.io/rules_rust/rust_fmt.html
87label_flag(
88 name = "rustfmt.toml",
89 build_setting_default = "//tools/rustfmt:rustfmt.toml",
90 visibility = ["//visibility:public"],
91)
92
93alias(
94 name = "rustfmt",
95 actual = "//tools/rustfmt",
96 visibility = ["//visibility:public"],
97)
98
99capture_clippy_output(
100 name = "capture_clippy_output",
101 build_setting_default = False,
102 visibility = ["//visibility:public"],
103)