blob: 69e43c7e9143876c6ac334e9c06c720a212e8fd6 [file] [log] [blame]
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("//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")
exports_files(["LICENSE"])
bzl_library(
name = "bzl_lib",
srcs = [
":workspace.bzl",
],
visibility = ["//visibility:public"],
)
# This setting may be changed from the command line to generate machine readable errors.
error_format(
name = "error_format",
build_setting_default = "human",
visibility = ["//visibility:public"],
)
# This setting may be used to pass extra options to clippy from the command line.
# It applies across all targets.
clippy_flags(
name = "clippy_flags",
build_setting_default = [],
visibility = ["//visibility:public"],
)
# This setting may be used to identify dependencies of proc-macro-s.
# This feature is only enabled if `is_proc_macro_dep_enabled` is true.
# Its value controls the BAZEL_RULES_RUST_IS_PROC_MACRO_DEP environment variable
# made available to the rustc invocation.
is_proc_macro_dep(
name = "is_proc_macro_dep",
build_setting_default = False,
visibility = ["//visibility:public"],
)
# This setting enables the feature to identify dependencies of proc-macro-s,
# see `is_proc_macro_dep`.
is_proc_macro_dep_enabled(
name = "is_proc_macro_dep_enabled",
build_setting_default = False,
visibility = ["//visibility:public"],
)
# This setting may be used to pass extra options to rustc from the command line
# in non-exec configuration.
# It applies across all targets whereas the rustc_flags option on targets applies only
# to that target. This can be useful for passing build-wide options such as LTO.
extra_rustc_flags(
name = "extra_rustc_flags",
build_setting_default = [],
visibility = ["//visibility:public"],
)
extra_rustc_flag(
name = "extra_rustc_flag",
build_setting_default = "",
visibility = ["//visibility:public"],
)
# This setting may be used to pass extra options to rustc from the command line
# in exec configuration.
# It applies across all targets whereas the rustc_flags option on targets applies only
# to that target. This can be useful for passing build-wide options such as LTO.
extra_exec_rustc_flags(
name = "extra_exec_rustc_flags",
build_setting_default = [],
visibility = ["//visibility:public"],
)
extra_exec_rustc_flag(
name = "extra_exec_rustc_flag",
build_setting_default = "",
visibility = ["//visibility:public"],
)
# This setting is used by the clippy rules. See https://bazelbuild.github.io/rules_rust/rust_clippy.html
label_flag(
name = "clippy.toml",
build_setting_default = "//tools/clippy:clippy.toml",
visibility = ["//visibility:public"],
)
# This setting is used by the rustfmt rules. See https://bazelbuild.github.io/rules_rust/rust_fmt.html
label_flag(
name = "rustfmt.toml",
build_setting_default = "//tools/rustfmt:rustfmt.toml",
visibility = ["//visibility:public"],
)
alias(
name = "rustfmt",
actual = "//tools/rustfmt",
visibility = ["//visibility:public"],
)
capture_clippy_output(
name = "capture_clippy_output",
build_setting_default = False,
visibility = ["//visibility:public"],
)