fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

Krasimir Georgievadd cc_common.link support for rust_library and rust_test (#1490)078c6908

0.11.0
1.7 KiB50 linesraw
1load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
3
4package(default_visibility = ["//visibility:public"])
5
6# A flag controlling whether to rename first-party crates such that their names
7# encode the Bazel package and target name, instead of just the target name.
8#
9# First-party vs. third-party crates are identified using the value of
10# //settings:third_party_dir.
11bool_flag(
12    name = "rename_first_party_crates",
13    build_setting_default = False,
14)
15
16# A flag specifying the location of vendored third-party rust crates within this
17# repository that must not be renamed when `rename_first_party_crates` is enabled.
18#
19# Must be specified as a Bazel package, e.g. "//some/location/in/repo".
20string_flag(
21    name = "third_party_dir",
22    build_setting_default = "//third_party/rust",
23)
24
25# A flag to control whether rust_library and rust_binary targets should
26# implicitly depend on the *real* import macro, or on a no-op target.
27bool_flag(
28    name = "use_real_import_macro",
29    build_setting_default = False,
30)
31
32# When set, this flag causes rustc to emit .rmeta files and use them for rlib -> rlib dependencies.
33# While this involves one extra (short) rustc invocation to build the rmeta file,
34# it allows library dependencies to be unlocked much sooner, increasing parallelism during compilation.
35bool_flag(
36    name = "pipelined_compilation",
37    build_setting_default = False,
38)
39
40# A flag to control whether to link rust_binary and rust_test targets using
41# cc_common.link instead of rustc.
42bool_flag(
43    name = "experimental_use_cc_common_link",
44    build_setting_default = False,
45)
46
47bzl_library(
48    name = "bzl_lib",
49    srcs = glob(["**/*.bzl"]),
50)