Skip to content

Commit d383a1a

Browse files
authored
feat: add extra rustc flags to bzlmod (#2996)
add `extra_rustc_flags` and `extra_exec_rustc_flags` to bzlmod.
1 parent 66bcafe commit d383a1a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rust/extensions.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def _rust_impl(module_ctx):
6161
rust_register_toolchains(
6262
dev_components = toolchain.dev_components,
6363
edition = toolchain.edition,
64+
extra_rustc_flags = toolchain.extra_rustc_flags,
65+
extra_exec_rustc_flags = toolchain.extra_exec_rustc_flags,
6466
allocator_library = toolchain.allocator_library,
6567
rustfmt_version = toolchain.rustfmt_version,
6668
rust_analyzer_version = toolchain.rust_analyzer_version,
@@ -109,6 +111,12 @@ _RUST_TOOLCHAIN_TAG = tag_class(
109111
extra_target_triples = attr.string_list(
110112
default = DEFAULT_EXTRA_TARGET_TRIPLES,
111113
),
114+
extra_exec_rustc_flags = attr.string_list(
115+
doc = "Extra flags to pass to rustc in exec configuration",
116+
),
117+
extra_rustc_flags = attr.string_list(
118+
doc = "Extra flags to pass to rustc in non-exec configuration",
119+
),
112120
rust_analyzer_version = attr.string(
113121
doc = "The version of Rustc to pair with rust-analyzer.",
114122
),

0 commit comments

Comments
 (0)