1
0
dust/build.rs

18 lines
511 B
Rust
Raw Permalink Normal View History

2023-09-28 19:58:01 +00:00
fn main() {
2023-10-05 13:25:09 +00:00
let src_dir = std::path::Path::new("tree-sitter-dust/src");
2023-09-28 19:58:01 +00:00
let mut c_config = cc::Build::new();
2024-01-31 15:19:26 +00:00
2023-10-30 19:48:43 +00:00
c_config.include(src_dir);
2023-09-28 19:58:01 +00:00
c_config
.flag_if_supported("-Wno-unused-parameter")
.flag_if_supported("-Wno-unused-but-set-variable")
.flag_if_supported("-Wno-trigraphs");
2024-01-31 15:19:26 +00:00
2023-09-28 19:58:01 +00:00
let parser_path = src_dir.join("parser.c");
2024-01-31 15:19:26 +00:00
c_config.file(&parser_path);
2023-09-28 19:58:01 +00:00
c_config.compile("parser");
2024-01-31 15:19:26 +00:00
2023-09-28 19:58:01 +00:00
println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap());
}