etnaviv: The relative path to build dir is not always valid, fix it

Use relative to source file location instead.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37390>
This commit is contained in:
Yonggang Luo 2025-09-10 16:01:18 +08:00 committed by Marge Bot
parent 974a79074b
commit e1b1e52529

View file

@ -163,7 +163,7 @@ fn generate_from_rule_impl_opc(isa: &ISA) -> TokenStream2 {
/// Main derive function to generate the parser
fn derive_parser(input: TokenStream) -> TokenStream {
let mut ast: DeriveInput = parse_macro_input!(input as DeriveInput);
let root = "../src/etnaviv/isa/";
let root = Path::new(file!()).parent().expect("Failed to located parent");
let (isa_filename, static_rules_filename) = parse_derive(&ast);
let isa_path = Path::new(&root).join(isa_filename);
let static_rules_path = Path::new(&root).join(static_rules_filename);