Move raw FFI bindings generation to separate crates. This makes it possible to reuse bindgen declarations for a header file in its dependencies (this was not the case before this change), while keeping multiple -sys crates to avoid rebuilding all the code whenever something changes. Because the -sys crates are generated in dependency order, this also enforces that the crates are organized in something that resembles the dependencies between C headers. The meson.build for rust-safe crates becomes simpler, and it should be possible in the future to let Meson's cargo support handle most of it. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> [General cleanup and Python script. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
13 lines
401 B
Meson
13 lines
401 B
Meson
_bindgen_util_rs = rust.bindgen(
|
|
args: bindgen_args_common + bindgen_args_data['util-sys'].split(),
|
|
kwargs: bindgen_kwargs)
|
|
_util_sys_rs = static_library(
|
|
'util_sys',
|
|
structured_sources(['lib.rs', _bindgen_util_rs]),
|
|
override_options: ['rust_std=2021', 'build.rust_std=2021'],
|
|
rust_abi: 'rust',
|
|
dependencies: [glib_sys_rs],
|
|
)
|
|
|
|
util_sys_rs = declare_dependency(link_with: [_util_sys_rs])
|