From 8ccdb881374084ddb90ef259539cfd3bb748c904 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 9 Aug 2023 16:20:34 -0700 Subject: Rust: Add a rust.proc_macro() method --- docs/markdown/Rust-module.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'docs/markdown/Rust-module.md') diff --git a/docs/markdown/Rust-module.md b/docs/markdown/Rust-module.md index bbc92fc25..0fb9edef7 100644 --- a/docs/markdown/Rust-module.md +++ b/docs/markdown/Rust-module.md @@ -105,3 +105,32 @@ were never turned on by Meson. [properties] bindgen_clang_arguments = ['--target', 'x86_64-linux-gnu'] ``` + +### proc_macro() + +```meson +rustmod.proc_macro(name, sources, ...) +``` + +*Since 1.3.0* + +This function creates a Rust `proc-macro` crate, similar to: +```meson +[[shared_library]](name, sources, + rust_crate_type: 'proc-macro', + native: true) +``` + +`proc-macro` targets can be passed to `link_with` keyword argument of other Rust +targets. + +Only a subset of [[shared_library]] keyword arguments are allowed: +- rust_args +- rust_dependency_map +- sources +- dependencies +- extra_files +- link_args +- link_depends +- link_with +- override_options -- cgit v1.2.3