diff options
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r-- | docs/markdown/snippets/rust_proc_macro_crates.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/markdown/snippets/rust_proc_macro_crates.md b/docs/markdown/snippets/rust_proc_macro_crates.md new file mode 100644 index 0000000..780a5b3 --- /dev/null +++ b/docs/markdown/snippets/rust_proc_macro_crates.md @@ -0,0 +1,16 @@ +## Rust proc-macro crates + +Rust has these handy things called proc-macro crates, which are a bit like a +compiler plugin. We can now support them, simply build a [[shared_library]] with +the `rust_crate_type` set to `proc-macro`. + +```meson +proc = shared_library( + 'proc', + 'proc.rs', + rust_crate_type : 'proc-macro', + install : false, +) + +user = executable('user, 'user.rs', link_with : proc) +``` |