Brian Silverman | cc09f18 | 2022-03-09 15:40:20 -0800 | [diff] [blame^] | 1 | load("@bazel_skylib//:bzl_library.bzl", "bzl_library") |
| 2 | load("//rust:defs.bzl", "capture_clippy_output", "error_format", "extra_exec_rustc_flags", "extra_rustc_flags") |
| 3 | |
| 4 | exports_files(["LICENSE"]) |
| 5 | |
| 6 | bzl_library( |
| 7 | name = "bzl_lib", |
| 8 | srcs = [ |
| 9 | ":workspace.bzl", |
| 10 | ], |
| 11 | visibility = ["//visibility:public"], |
| 12 | ) |
| 13 | |
| 14 | alias( |
| 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. |
| 22 | error_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. |
| 32 | extra_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. |
| 42 | extra_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 |
| 49 | label_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 |
| 56 | label_flag( |
| 57 | name = "rustfmt.toml", |
| 58 | build_setting_default = "//tools/rustfmt:rustfmt.toml", |
| 59 | visibility = ["//visibility:public"], |
| 60 | ) |
| 61 | |
| 62 | alias( |
| 63 | name = "rustfmt", |
| 64 | actual = "//tools/rustfmt", |
| 65 | visibility = ["//visibility:public"], |
| 66 | ) |
| 67 | |
| 68 | capture_clippy_output( |
| 69 | name = "capture_clippy_output", |
| 70 | build_setting_default = False, |
| 71 | visibility = ["//visibility:public"], |
| 72 | ) |