From f3a6e9bc475504152e45e5fbf86c756157438d08 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 12 Nov 2024 11:54:11 +0100 Subject: rust: build: move rustc_args.py invocation to qemu-api crate Only qemu-api needs access to the symbols in config-host.h. Remove the temptation to use them elsewhere by limiting the --cfg arguments to the qemu-api crate. Per-crate invocation of the script will also be needed to add --check-cfg options for each crate's features (when more complex, build-time configurable devices are added in the future). Signed-off-by: Paolo Bonzini --- rust/qemu-api/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rust') diff --git a/rust/qemu-api/meson.build b/rust/qemu-api/meson.build index 3be7b7e..5df6b35 100644 --- a/rust/qemu-api/meson.build +++ b/rust/qemu-api/meson.build @@ -1,4 +1,7 @@ -_qemu_api_cfg = [] +_qemu_api_cfg = run_command(rustc_args, + '--config-headers', config_host_h, + capture: true, check: true).stdout().strip().split() + # _qemu_api_cfg += ['--cfg', 'feature="allocator"'] if rustc.version().version_compare('>=1.77.0') _qemu_api_cfg += ['--cfg', 'has_offset_of'] -- cgit v1.1