[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v3 23/32] qga/rust: build and link an empty static library
|
From: |
marcandre . lureau |
|
Subject: |
[RFC v3 23/32] qga/rust: build and link an empty static library |
|
Date: |
Tue, 7 Sep 2021 16:19:34 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
Cargo.lock | 4 ++++
Cargo.toml | 1 +
qga/Cargo.toml | 9 +++++++++
qga/lib.rs | 0
qga/meson.build | 20 +++++++++++++++++++-
5 files changed, 33 insertions(+), 1 deletion(-)
create mode 100644 qga/Cargo.toml
create mode 100644 qga/lib.rs
diff --git a/Cargo.lock b/Cargo.lock
index f2cd0ee96e..2f5b202605 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -68,3 +68,7 @@ version = "0.0.1"
dependencies = [
"common",
]
+
+[[package]]
+name = "qga"
+version = "0.1.0"
diff --git a/Cargo.toml b/Cargo.toml
index f4a078e62d..3db0646413 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,5 +1,6 @@
[workspace]
members = [
+ "qga",
"rust/common",
"tests",
]
diff --git a/qga/Cargo.toml b/qga/Cargo.toml
new file mode 100644
index 0000000000..a3bffd1fec
--- /dev/null
+++ b/qga/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "qga"
+version = "0.1.0"
+edition = "2018"
+publish = false
+
+[lib]
+path = "lib.rs"
+crate-type = ["staticlib"]
diff --git a/qga/lib.rs b/qga/lib.rs
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/qga/meson.build b/qga/meson.build
index 1b050d8c53..d272892ced 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -54,9 +54,27 @@ qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
qga_ss = qga_ss.apply(config_host, strict: false)
+qga_rs = declare_dependency()
+if with_rust
+ cargo_qga = custom_target('cargo-qga',
+ build_by_default: true,
+ output: ['libqga.args', 'libqga.a'],
+ build_always_stale: true,
+ command: [cargo_wrapper,
+ meson.current_build_dir(),
+ meson.current_source_dir(),
+ meson.build_root(),
+ rs_build_type,
+ rust_target_triple,
+ 'build-lib'])
+ qga_rs = declare_dependency(
+ link_args: '@' + cargo_qga[0].full_path(),
+ sources: cargo_qga)
+endif
+
qga = executable('qemu-ga', qga_ss.sources(),
link_args: config_host['LIBS_QGA'].split(),
- dependencies: [qemuutil, libudev],
+ dependencies: [qemuutil, libudev, qga_rs],
install: true)
all_qga = [qga]
--
2.33.0.113.g6c40894d24
- Re: [RFC v3 14/32] scripts/qapi: add QAPISchemaIfCond.rsgen(), (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 <=
- [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, 2021/09/07
- [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