[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/49] rust: apply --cfg MESON to all crates
From: |
Paolo Bonzini |
Subject: |
[PULL 02/49] rust: apply --cfg MESON to all crates |
Date: |
Wed, 11 Dec 2024 17:26:32 +0100 |
We might have more uses for --cfg MESON, even though right now it's only
qemu-api that has generated files. Since we're going to add more flags
to the add_project_arguments calls for Rust, it makes sense to also add
--cfg MESON everywhere.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 7 ++++---
rust/qemu-api/meson.build | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index 147097c652e..c35ce64cd61 100644
--- a/meson.build
+++ b/meson.build
@@ -3422,10 +3422,11 @@ if have_rust
# is safe; https://github.com/rust-lang/rust/pull/54675 says that
# passing -nodefaultlibs to the linker "was more ideological to
# start with than anything".
- add_project_arguments(rustc_args + ['-C', 'default-linker-libraries'],
+ add_project_arguments(rustc_args +
+ ['--cfg', 'MESON', '-C', 'default-linker-libraries'],
native: false, language: 'rust')
-
- add_project_arguments(rustc_args, native: true, language: 'rust')
+ add_project_arguments(rustc_args + ['--cfg', 'MESON'],
+ native: true, language: 'rust')
endif
hxtool = find_program('scripts/hxtool')
diff --git a/rust/qemu-api/meson.build b/rust/qemu-api/meson.build
index 6f637af7b1b..cad9ac4844e 100644
--- a/rust/qemu-api/meson.build
+++ b/rust/qemu-api/meson.build
@@ -1,4 +1,4 @@
-_qemu_api_cfg = ['--cfg', 'MESON']
+_qemu_api_cfg = []
# _qemu_api_cfg += ['--cfg', 'feature="allocator"']
if rustc.version().version_compare('>=1.77.0')
_qemu_api_cfg += ['--cfg', 'has_offset_of']
--
2.47.1
- [PULL 00/49] rust, QOM, kvm changes for 2024-12-11, Paolo Bonzini, 2024/12/11
- [PULL 01/49] ci: enable rust in the Debian and Ubuntu system build job, Paolo Bonzini, 2024/12/11
- [PULL 02/49] rust: apply --cfg MESON to all crates,
Paolo Bonzini <=
- [PULL 04/49] rust: build: move rustc_args.py invocation to qemu-api crate, Paolo Bonzini, 2024/12/11
- [PULL 05/49] rust: build: restrict --cfg generation to only required symbols, Paolo Bonzini, 2024/12/11
- [PULL 03/49] rust: allow using build-root bindings.rs from cargo, Paolo Bonzini, 2024/12/11
- [PULL 06/49] rust: build: generate lint flags from Cargo.toml, Paolo Bonzini, 2024/12/11
- [PULL 07/49] rust: cargo: store desired warning levels in workspace Cargo.toml, Paolo Bonzini, 2024/12/11
- [PULL 09/49] rust: fix a couple style issues from clippy, Paolo Bonzini, 2024/12/11
- [PULL 10/49] rust: build: establish a baseline of lints across all crates, Paolo Bonzini, 2024/12/11
- [PULL 11/49] rust: build: add "make clippy", "make rustfmt", "make rustdoc", Paolo Bonzini, 2024/12/11
- [PULL 13/49] rust: fix doc test syntax, Paolo Bonzini, 2024/12/11
- [PULL 08/49] rust: build: move strict lints handling to rustc_args.py, Paolo Bonzini, 2024/12/11