Manos Pitsidianakis <[email protected]> writes:

> This commit adds a helper crate library, qemu-api-macros for derive (and
> other procedural) macros to be used along qemu-api.
>
> It needs to be a separate library because in Rust, procedural macros, or
> macros that can generate arbitrary code, need to be special separate
> compilation units.
>
> Only one macro is introduced in this patch, #[derive(Object)]. It
> generates a constructor to register a QOM TypeInfo on init and it must
> be used on types that implement qemu_api::definitions::ObjectImpl trait.
>
> Signed-off-by: Manos Pitsidianakis <[email protected]>

Reviewed-by: Junjie Mao <[email protected]>

> ---
>  MAINTAINERS                                        |  1 +
>  rust/meson.build                                   |  1 +
>  rust/qemu-api-macros/Cargo.lock                    | 47 
> ++++++++++++++++++++++
>  rust/qemu-api-macros/Cargo.toml                    | 25 ++++++++++++
>  rust/qemu-api-macros/README.md                     |  1 +
>  rust/qemu-api-macros/meson.build                   | 25 ++++++++++++
>  rust/qemu-api-macros/src/lib.rs                    | 43 ++++++++++++++++++++
>  rust/qemu-api/meson.build                          |  3 ++
>  scripts/archive-source.sh                          |  4 +-
>  scripts/make-release                               |  3 +-
>  subprojects/.gitignore                             |  4 ++
>  .../packagefiles/proc-macro2-1-rs/meson.build      | 31 ++++++++++++++
>  subprojects/packagefiles/quote-1-rs/meson.build    | 29 +++++++++++++
>  subprojects/packagefiles/syn-2-rs/meson.build      | 40 ++++++++++++++++++
>  subprojects/proc-macro2-1-rs.wrap                  |  7 ++++
>  subprojects/quote-1-rs.wrap                        |  7 ++++
>  subprojects/syn-2-rs.wrap                          |  7 ++++
>  subprojects/unicode-ident-1-rs.wrap                |  7 ++++
>  subprojects/unicode-ident-1-rs/meson.build         | 20 +++++++++
>  19 files changed, 303 insertions(+), 2 deletions(-)

Reply via email to