spirv_cross2_derive/lib.rs
1mod derive;
2
3use proc_macro::TokenStream;
4use syn::{parse_macro_input, DeriveInput};
5
6#[proc_macro_derive(CompilerOptions, attributes(option, expand))]
7pub fn compiler_options_derive(input: TokenStream) -> TokenStream {
8 // Parse the input tokens into a syntax tree
9 let input = parse_macro_input!(input as DeriveInput);
10
11 derive::do_derive(input)
12 .unwrap_or_else(syn::Error::into_compile_error)
13 .into()
14}