wiggle: make paths relative to use site of macro
prior to this change, they were relative to CARGO_MANIFEST_DIR for the wiggle-generate crate.
This commit is contained in:
@@ -5,7 +5,10 @@ use syn::parse_macro_input;
|
||||
|
||||
#[proc_macro]
|
||||
pub fn from_witx(args: TokenStream) -> TokenStream {
|
||||
let config = parse_macro_input!(args as wiggle_generate::Config);
|
||||
let mut config = parse_macro_input!(args as wiggle_generate::Config);
|
||||
config.witx.make_paths_relative_to(
|
||||
std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR env var"),
|
||||
);
|
||||
let doc = witx::load(&config.witx.paths).expect("loading witx");
|
||||
TokenStream::from(wiggle_generate::generate(&doc, &config))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user