mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00

Crates like "bilge" and "libc" can be shared by more than one directory, so declare them directly in rust/meson.build. While at it, make their variable names end with "_rs" and always add a subproject() statement (as that pinpoints the error better if the subproject is missing and cannot be downloaded). Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
20 lines
577 B
Meson
20 lines
577 B
Meson
_libpl011_rs = static_library(
|
|
'pl011',
|
|
files('src/lib.rs'),
|
|
override_options: ['rust_std=2021', 'build.rust_std=2021'],
|
|
rust_abi: 'rust',
|
|
dependencies: [
|
|
bilge_rs,
|
|
bilge_impl_rs,
|
|
qemu_api,
|
|
qemu_api_macros,
|
|
],
|
|
)
|
|
|
|
rust_devices_ss.add(when: 'CONFIG_X_PL011_RUST', if_true: [declare_dependency(
|
|
link_whole: [_libpl011_rs],
|
|
# Putting proc macro crates in `dependencies` is necessary for Meson to find
|
|
# them when compiling the root per-target static rust lib.
|
|
dependencies: [bilge_impl_rs, qemu_api_macros],
|
|
variables: {'crate': 'pl011'},
|
|
)])
|