Skip to content

Commit d4e7307

Browse files
committed
rust: kbuild: support skipping flags in rustc_test_library
Crates like `quote` (added later) will need the ability to skip flags in the `rustc_test_library` command. Thus add the support for it. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Gary Guo <gary@garyguo.net> Tested-by: Gary Guo <gary@garyguo.net> Tested-by: Jesung Yang <y.j3ms.n@gmail.com> Link: https://patch.msgid.link/20251124151837.2184382-5-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 7dbe46c commit d4e7307

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rust/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ rustdoc-clean: FORCE
172172
quiet_cmd_rustc_test_library = $(RUSTC_OR_CLIPPY_QUIET) TL $<
173173
cmd_rustc_test_library = \
174174
OBJTREE=$(abspath $(objtree)) \
175-
$(RUSTC_OR_CLIPPY) $(rust_common_flags) \
176-
@$(objtree)/include/generated/rustc_cfg $(rustc_target_flags) \
175+
$(RUSTC_OR_CLIPPY) $(filter-out $(skip_flags),$(rust_common_flags) $(rustc_target_flags)) \
176+
@$(objtree)/include/generated/rustc_cfg \
177177
--crate-type $(if $(rustc_test_library_proc),proc-macro,rlib) \
178178
--out-dir $(objtree)/$(obj)/test --cfg testlib \
179179
-L$(objtree)/$(obj)/test \

0 commit comments

Comments
 (0)