Prior to Meson 1.10, if the config-host.h dependency of qemuutil ends up
as the first source file, it can be passed to rustc---which gets rather
confused because config-host.h looks nothing like Rust code.
While this can usually be avoided in the individual targets, a simple
and universal workaround is to remove the sources (and C compile
arguments, while at it) from the "util_rs" dependency. This hides
config-host.h from the Rust targets---and they don't need it anyway.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/util/meson.build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/rust/util/meson.build b/rust/util/meson.build
index 95aa211ef0b..2aa32a233eb 100644
--- a/rust/util/meson.build
+++ b/rust/util/meson.build
@@ -41,7 +41,9 @@ _util_rs = static_library(
dependencies: [anyhow_rs, libc_rs, foreign_rs, glib_sys_rs, common_rs],
)
-util_rs = declare_dependency(link_with: [_util_rs], dependencies: [qemuutil, qom])
+util_rs = declare_dependency(link_with: [_util_rs], dependencies: [
+ qemuutil.partial_dependency(links: true, link_args: true),
+ qom])
rust.test('rust-util-tests', _util_rs,
dependencies: [qemuutil, qom],
--
2.51.1