mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
rust: build: generate lint flags from Cargo.toml
Cargo.toml makes it possible to describe the desired lint level settings in a nice format. We can extend this to Meson-built crates, by teaching rustc_args.py to fetch lint and --check-cfg arguments from Cargo.toml. --check-cfg arguments come from the unexpected_cfgs lint as well as crate features Start with qemu-api, since it already has a [lints.rust] table and an invocation of rustc_args.py. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
1de82059aa
commit
97ed1e9c8e
3 changed files with 86 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
_qemu_api_cfg = run_command(rustc_args,
|
||||
'--config-headers', config_host_h, files('Cargo.toml'),
|
||||
capture: true, check: true).stdout().strip().split()
|
||||
'--config-headers', config_host_h, '--features', '--lints', files('Cargo.toml'),
|
||||
capture: true, check: true).stdout().strip().splitlines()
|
||||
|
||||
# _qemu_api_cfg += ['--cfg', 'feature="allocator"']
|
||||
if rustc.version().version_compare('>=1.77.0')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue