diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-10-18 16:30:56 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-11-05 14:18:15 +0100 |
commit | cde3c425d16f6d0c8e6f47940ef5152b9021f3f2 (patch) | |
tree | 7c501a0aab7f6c4f25b437b5f7ed1c2f5d1b7025 /meson.build | |
parent | 4f7521916d12e07d25d5175f2da9614624344a7b (diff) |
rust: build integration test for the qemu_api crate
Adjust the integration test to compile with a subset of QEMU object
files, and make it actually create an object of the class it defines.
Follow the Rust filesystem conventions, where tests go in tests/ if
they use the library in the same way any other code would.
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 4bf397ef3b..ac0f03d2e7 100644 --- a/meson.build +++ b/meson.build @@ -3345,7 +3345,15 @@ if have_rust and have_system # Prohibit code that is forbidden in Rust 2024 rustc_args += ['-D', 'unsafe_op_in_unsafe_fn'] - add_project_arguments(rustc_args, native: false, language: 'rust') + + # Apart from procedural macros, our Rust executables will often link + # with C code, so include all the libraries that C code needs. This + # 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'], + native: false, language: 'rust') + add_project_arguments(rustc_args, native: true, language: 'rust') endif |