qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v3 1/5] build-sys: Add rust feature option


From: Manos Pitsidianakis
Subject: Re: [RFC PATCH v3 1/5] build-sys: Add rust feature option
Date: Tue, 02 Jul 2024 17:38:12 +0300
User-agent: meli 0.8.6

Hi Daniel, I missed one of your questions and I just re-read the thread today,

On Mon, 24 Jun 2024 19:52, "Daniel P. Berrangé" <berrange@redhat.com> wrote:
On Wed, Jun 19, 2024 at 11:13:58PM +0300, Manos Pitsidianakis wrote:
Add options for Rust in meson_options.txt, meson.build, configure to
prepare for adding Rust code in the followup commits.

`rust` is a reserved meson name, so we have to use an alternative.
`with_rust` was chosen.

A cargo_wrapper.py script is added that is heavily based on the work of
Marc-André Lureau from 2021.

https://patchew.org/QEMU/20210907121943.3498701-1-marcandre.lureau@redhat.com/

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
 MAINTAINERS                   |   5 +
 configure                     |  11 ++
 meson.build                   |  11 ++
 meson_options.txt             |   4 +
 scripts/cargo_wrapper.py      | 279 ++++++++++++++++++++++++++++++++++
 scripts/meson-buildoptions.sh |   6 +
 6 files changed, 316 insertions(+)
 create mode 100644 scripts/cargo_wrapper.py

diff --git a/configure b/configure
index 38ee257701..6894d7c2d1 100755
--- a/configure
+++ b/configure
@@ -302,6 +302,9 @@ else
   objcc="${objcc-${cross_prefix}clang}"
 fi

[..snip..]
+with_rust_target_triple=""
+
 ar="${AR-${cross_prefix}ar}"
 as="${AS-${cross_prefix}as}"
 ccas="${CCAS-$cc}"
@@ -760,6 +763,12 @@ for opt do
   ;;
   --gdb=*) gdb_bin="$optarg"
   ;;
+  --enable-with-rust) with_rust=enabled
+  ;;
+  --disable-with-rust) with_rust=disabled
+  ;;

--enable-with-XXX / --disable-with-XXX is pretty unsual naming.

Normally you'd see either --enable-XXX or --with-XXX and their
corresponding --disable-XXX or --without-XXX.

True. As the commit message says, `rust` is a reserved meson feature name, so the auto-generated scripts/meson-buildoptions.sh
has the following args:

 --enable-with-rust
 --disable-with-rust

I used the same in `configure` even though it's not autogenerated in order to keep the two synced. If there's a way to get around this I'd prefer it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]