wiggle: witx paths use shell expansion

instead of always being relative to CARGO_MANIFEST_DIR, each use site is
responsible for either putting that variable or another one (set by a
build.rs) at the start of witx paths.
This commit is contained in:
Pat Hickey
2020-08-28 15:41:19 -07:00
parent 5c6ed0c736
commit 91dac9c7e8
5 changed files with 25 additions and 52 deletions

View File

@@ -90,10 +90,7 @@ use syn::parse_macro_input;
/// ```
#[proc_macro]
pub fn from_witx(args: TokenStream) -> TokenStream {
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 config = parse_macro_input!(args as wiggle_generate::Config);
let doc = config.load_document();
let names = wiggle_generate::Names::new(&config.ctx.name, quote!(wiggle));