mirror of https://github.com/xemu-project/xemu.git
meson: pass rustc_args when building all crates
rustc_args is needed to smooth the difference in warnings between the various versions of rustc. Always include those arguments. Reviewed-by: Junjie Mao <junjie.mao@hotmail.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
d1e526c170
commit
7b72c7dd0d
20
meson.build
20
meson.build
|
@ -3336,6 +3336,19 @@ endif
|
||||||
|
|
||||||
genh += configure_file(output: 'config-host.h', configuration: config_host_data)
|
genh += configure_file(output: 'config-host.h', configuration: config_host_data)
|
||||||
|
|
||||||
|
if have_rust and have_system
|
||||||
|
rustc_args = run_command(
|
||||||
|
find_program('scripts/rust/rustc_args.py'),
|
||||||
|
'--config-headers', meson.project_build_root() / 'config-host.h',
|
||||||
|
capture : true,
|
||||||
|
check: true).stdout().strip().split()
|
||||||
|
|
||||||
|
# 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')
|
||||||
|
add_project_arguments(rustc_args, native: true, language: 'rust')
|
||||||
|
endif
|
||||||
|
|
||||||
hxtool = find_program('scripts/hxtool')
|
hxtool = find_program('scripts/hxtool')
|
||||||
shaderinclude = find_program('scripts/shaderinclude.py')
|
shaderinclude = find_program('scripts/shaderinclude.py')
|
||||||
qapi_gen = find_program('scripts/qapi-gen.py')
|
qapi_gen = find_program('scripts/qapi-gen.py')
|
||||||
|
@ -3929,12 +3942,6 @@ common_all = static_library('common',
|
||||||
dependencies: common_ss.all_dependencies())
|
dependencies: common_ss.all_dependencies())
|
||||||
|
|
||||||
if have_rust and have_system
|
if have_rust and have_system
|
||||||
rustc_args = run_command(
|
|
||||||
find_program('scripts/rust/rustc_args.py'),
|
|
||||||
'--config-headers', meson.project_build_root() / 'config-host.h',
|
|
||||||
capture : true,
|
|
||||||
check: true).stdout().strip().split()
|
|
||||||
rustc_args += ['-D', 'unsafe_op_in_unsafe_fn']
|
|
||||||
bindgen_args = [
|
bindgen_args = [
|
||||||
'--disable-header-comment',
|
'--disable-header-comment',
|
||||||
'--raw-line', '// @generated',
|
'--raw-line', '// @generated',
|
||||||
|
@ -4107,7 +4114,6 @@ foreach target : target_dirs
|
||||||
rlib_rs,
|
rlib_rs,
|
||||||
dependencies: target_rust.dependencies(),
|
dependencies: target_rust.dependencies(),
|
||||||
override_options: ['rust_std=2021', 'build.rust_std=2021'],
|
override_options: ['rust_std=2021', 'build.rust_std=2021'],
|
||||||
rust_args: rustc_args,
|
|
||||||
rust_abi: 'c')
|
rust_abi: 'c')
|
||||||
arch_deps += declare_dependency(link_whole: [rlib])
|
arch_deps += declare_dependency(link_whole: [rlib])
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -10,7 +10,7 @@ _qemu_api_rs = static_library(
|
||||||
),
|
),
|
||||||
override_options: ['rust_std=2021', 'build.rust_std=2021'],
|
override_options: ['rust_std=2021', 'build.rust_std=2021'],
|
||||||
rust_abi: 'rust',
|
rust_abi: 'rust',
|
||||||
rust_args: rustc_args + [
|
rust_args: [
|
||||||
'--cfg', 'MESON',
|
'--cfg', 'MESON',
|
||||||
# '--cfg', 'feature="allocator"',
|
# '--cfg', 'feature="allocator"',
|
||||||
],
|
],
|
||||||
|
|
|
@ -16,10 +16,12 @@ macro_rules! device_class_init {
|
||||||
) {
|
) {
|
||||||
let mut dc =
|
let mut dc =
|
||||||
::core::ptr::NonNull::new(klass.cast::<$crate::bindings::DeviceClass>()).unwrap();
|
::core::ptr::NonNull::new(klass.cast::<$crate::bindings::DeviceClass>()).unwrap();
|
||||||
dc.as_mut().realize = $realize_fn;
|
unsafe {
|
||||||
dc.as_mut().vmsd = &$vmsd;
|
dc.as_mut().realize = $realize_fn;
|
||||||
$crate::bindings::device_class_set_legacy_reset(dc.as_mut(), $legacy_reset_fn);
|
dc.as_mut().vmsd = &$vmsd;
|
||||||
$crate::bindings::device_class_set_props(dc.as_mut(), $props.as_mut_ptr());
|
$crate::bindings::device_class_set_legacy_reset(dc.as_mut(), $legacy_reset_fn);
|
||||||
|
$crate::bindings::device_class_set_props(dc.as_mut(), $props.as_mut_ptr());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue