subprojects: add glib-sys-rs

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Marc-André Lureau
2025-10-01 08:52:32 +02:00
committed by Paolo Bonzini
parent faccaa34f0
commit 4c18783a88
5 changed files with 44 additions and 0 deletions
+1
View File
@@ -13,6 +13,7 @@
/bilge-impl-*
/either-*
/foreign-*
/glib-sys-*
/itertools-*
/libc-*
/proc-macro-error-*
+7
View File
@@ -0,0 +1,7 @@
[wrap-file]
directory = glib-sys-0.21.2
source_url = https://crates.io/api/v1/crates/glib-sys/0.21.2/download
source_filename = glib-sys-0.21.2.tar.gz
source_hash = d09d3d0fddf7239521674e57b0465dfbd844632fec54f059f7f56112e3f927e1
#method = cargo
patch_directory = glib-sys-0.21-rs
@@ -0,0 +1,33 @@
project('glib-sys-0.21-rs', 'rust',
meson_version: '>=1.5.0',
version: '0.21.2',
license: 'MIT',
default_options: [])
subproject('libc-0.2-rs', required: true)
libc_rs = dependency('libc-0.2-rs')
_glib_sys_rs = static_library(
'glib_sys',
files('src/lib.rs'),
gnu_symbol_visibility: 'hidden',
override_options: ['rust_std=2021', 'build.rust_std=2021'],
rust_abi: 'rust',
rust_args: [
'--cap-lints', 'allow',
'--cfg', 'feature="v2_66"',
'--cfg', 'feature="v2_64"',
'--cfg', 'feature="v2_62"',
'--cfg', 'feature="v2_60"',
'--cfg', 'feature="v2_58"',
],
# should also link with glib; don't bother doing it here since all
# QEMU targets have it
dependencies: [libc_rs],
)
glib_sys_dep = declare_dependency(
link_with: _glib_sys_rs,
)
meson.override_dependency('glib-sys-0.21-rs', glib_sys_dep)