diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-11-12 11:35:34 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-12-10 18:44:06 +0100 |
commit | 8c2866750319fac3f7b641d1a097f3779952631d (patch) | |
tree | 8a9f89d8c1402314c76d43fd35dfa3f1fb3296c9 | |
parent | 72d6ed19bf25e1289be7b05326d3ed3c9f0cabe9 (diff) | |
download | qemu-8c2866750319fac3f7b641d1a097f3779952631d.zip qemu-8c2866750319fac3f7b641d1a097f3779952631d.tar.gz qemu-8c2866750319fac3f7b641d1a097f3779952631d.tar.bz2 |
rust: apply --cfg MESON to all crates
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>
-rw-r--r-- | meson.build | 7 | ||||
-rw-r--r-- | rust/qemu-api/meson.build | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/meson.build b/meson.build index 147097c..c35ce64 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 6f637af..cad9ac4 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'] |