use std::path::PathBuf; fn main() { let dirs: Vec = [ &["grammars", "tree-sitter-rust", "src"][..], &["grammars", "tree-sitter-python", "src"][..], ] .iter() .map(|path| path.iter().collect::()) .collect(); let mut cc_build = cc::Build::new(); for dir in dirs { cc_build.include(&dir).file(dir.join("parser.c")); if !dir.ends_with("tree-sitter-c/src") { cc_build.file(dir.join("scanner.c")); } } // cc_build.compile("tree-sitter-languages"); }