2022-12-18 15:15:39 -03:00
|
|
|
fn main() {
|
2023-05-04 14:24:47 -04:00
|
|
|
let c_paths: Vec<std::path::PathBuf> = glob::glob("src/**/*.c")
|
|
|
|
.unwrap()
|
|
|
|
.filter_map(|g| g.ok())
|
|
|
|
.collect();
|
|
|
|
let h_paths: Vec<std::path::PathBuf> = glob::glob("include/**/*.h")
|
|
|
|
.unwrap()
|
|
|
|
.filter_map(|g| g.ok())
|
|
|
|
.collect();
|
2023-06-10 10:20:16 -04:00
|
|
|
let tables_paths: Vec<std::path::PathBuf> = glob::glob("tables/tables/**/*.inc")
|
|
|
|
.unwrap()
|
|
|
|
.filter_map(|g| g.ok())
|
|
|
|
.collect();
|
2022-12-18 17:12:59 -03:00
|
|
|
|
2023-06-10 10:20:16 -04:00
|
|
|
for path in c_paths.iter().chain(&h_paths).chain(&tables_paths) {
|
2022-12-18 17:12:59 -03:00
|
|
|
println!("cargo:rerun-if-changed={}", path.to_string_lossy());
|
|
|
|
}
|
|
|
|
|
2023-05-04 14:58:54 -04:00
|
|
|
assert!(!c_paths.is_empty());
|
2022-12-18 17:12:59 -03:00
|
|
|
|
|
|
|
cc::Build::new()
|
|
|
|
.files(c_paths)
|
2022-12-18 19:43:40 -03:00
|
|
|
.include("include")
|
2023-05-02 19:09:47 -04:00
|
|
|
.include("tables")
|
2022-12-18 17:12:59 -03:00
|
|
|
.warnings(false)
|
|
|
|
.compile("rabbitizer");
|
2022-12-18 15:15:39 -03:00
|
|
|
}
|