Commit Graph

3 Commits

Author SHA1 Message Date
Paolo Bonzini 3d751645b0 clippy: skip "linker" blocks in target_sources
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-01-19 20:47:01 +02:00
Paolo Bonzini 04067fcad7 clippy: skip running it if --cap-lints allow is included in the command line
Meson builds libraries before running clippy, thus all dependencies must be present
and clippy is run only for the warnings (instead, Cargo treats clippy as a separate
toolchain and builds everything).  In Meson's case thus it is pointless to run
clippy whenever --cap-lints allow is included in the command line.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-01-08 12:07:31 +02:00
Paolo Bonzini 27c567de5d scripts: add "clippy" internal tool
Similar to the "ninja scan-build" target for C, add a clippy internal
tool that runs clippy-driver on all crates in the project.

The approach used is more efficient than with "ninja scan-build", and
does not require rerunning Meson in a separate build directory; it
uses the introspection data to find the compiler arguments for the
target and invokes clippy-driver with a slightly modified command
line.

This could actually be applied to scan-build as well, reusing the
run_tool_on_targets() function.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-12-19 09:25:20 -08:00