[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v3 25/32] qga/rust: build a qga-cabi-rs executable (ABI from Rust)
From: |
marcandre . lureau |
Subject: |
[RFC v3 25/32] qga/rust: build a qga-cabi-rs executable (ABI from Rust) |
Date: |
Tue, 7 Sep 2021 16:19:36 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
qga/Cargo.toml | 5 +++++
qga/meson.build | 15 +++++++++++++++
qga/qapi-cabi.rs | 6 ++++++
3 files changed, 26 insertions(+)
create mode 100644 qga/qapi-cabi.rs
diff --git a/qga/Cargo.toml b/qga/Cargo.toml
index 807acc947e..d262b847fa 100644
--- a/qga/Cargo.toml
+++ b/qga/Cargo.toml
@@ -10,3 +10,8 @@ common = { path = "../rust/common" }
[lib]
path = "lib.rs"
crate-type = ["staticlib"]
+
+[[bin]]
+name = "qapi-cabi-rs"
+path = "qapi-cabi.rs"
+doc = false
diff --git a/qga/meson.build b/qga/meson.build
index 88d59bef0c..fd840f5c73 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -81,6 +81,21 @@ if with_rust
qga_rs = declare_dependency(
link_args: '@' + cargo_qga[0].full_path(),
sources: cargo_qga)
+
+ cargo_qga_cabi = custom_target('qga-qapi-cabi-rs',
+ output: ['qapi-cabi-rs' + exe_suffix],
+ build_always_stale: true,
+ depends: [qapi_gen_rs_files],
+ command: [cargo_wrapper,
+ meson.current_build_dir(),
+ meson.current_source_dir(),
+ meson.build_root(),
+ rs_build_type,
+ rust_target_triple,
+ 'build-bin',
+ 'qapi-cabi-rs',
+ '--', '--cfg', 'QAPI_CABI'])
+
endif
qga = executable('qemu-ga', qga_ss.sources(),
diff --git a/qga/qapi-cabi.rs b/qga/qapi-cabi.rs
new file mode 100644
index 0000000000..d98a819ef7
--- /dev/null
+++ b/qga/qapi-cabi.rs
@@ -0,0 +1,6 @@
+pub use common::{err, Error, Result};
+mod qapi_ffi;
+
+fn main() {
+ qapi_ffi::cabi()
+}
--
2.33.0.113.g6c40894d24
- [RFC v3 15/32] scripts/qapi: strip trailing whitespaces, (continued)
- [RFC v3 15/32] scripts/qapi: strip trailing whitespaces, marcandre . lureau, 2021/09/07
- [RFC v3 16/32] scripts/qapi: add Rust FFI bindings generation, marcandre . lureau, 2021/09/07
- [RFC v3 17/32] scripts/qapi: learn to generate ABI dump for Rust FFI, marcandre . lureau, 2021/09/07
- [RFC v3 18/32] tests: generate Rust bindings, marcandre . lureau, 2021/09/07
- [RFC v3 19/32] tests: check Rust and C CABI diffs, marcandre . lureau, 2021/09/07
- [RFC v3 20/32] scripts/qapi: generate high-level Rust bindings, marcandre . lureau, 2021/09/07
- [RFC v3 22/32] qga: build qapi-cabi binary (ABI from C), marcandre . lureau, 2021/09/07
- [RFC v3 21/32] tests/rust: build a common library, checking bindings compile, marcandre . lureau, 2021/09/07
- [RFC v3 23/32] qga/rust: build and link an empty static library, marcandre . lureau, 2021/09/07
- [RFC v3 24/32] qga/rust: generate QGA QAPI types FFI bindings, marcandre . lureau, 2021/09/07
- [RFC v3 25/32] qga/rust: build a qga-cabi-rs executable (ABI from Rust),
marcandre . lureau <=
- [RFC v3 26/32] qga/rust: check the Rust C binding, marcandre . lureau, 2021/09/07
- [RFC v3 27/32] qga/rust: build high-level Rust QAPI types, marcandre . lureau, 2021/09/07
- [RFC v3 28/32] qga/rust: implement get-host-name in Rust (example), marcandre . lureau, 2021/09/07
- [RFC v3 29/32] qga/rust: implement {get,set}-vcpus in Rust (example), marcandre . lureau, 2021/09/07
- [RFC v3 30/32] tests/vm: add Rust to FreeBSD VM, marcandre . lureau, 2021/09/07
- [RFC v3 31/32] tests/vm: bump fedora VM to f32, marcandre . lureau, 2021/09/07
- [RFC v3 32/32] tests/vm: add Rust to Fedora, marcandre . lureau, 2021/09/07
- Re: [RFC v3 00/32] Rust binding for QAPI and qemu-ga QMP handler examples, Markus Armbruster, 2021/09/08