Debian Codegraph @

Xtree-house/bindings/build.rs

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 use std::path::Path;
2 use std::{env, fs};
3
4 fn main() {
•5 println!("dh-cargo:deb-built-using=tree-sitter=0={}", env::var("CARGO_MANIFEST_DIR").unwrap());
6 if env::var_os("DISABLED_TS_BUILD").is_some() {
7 return;
8 }
9 let mut config = cc::Build::new();
10
11 let manifest_path = Path::new(env!("CARGO_MANIFEST_DIR"));
12 let include_path = manifest_path.join("vendor/include");
13 let src_path = manifest_path.join("vendor/src");
14 for entry in fs::read_dir(&src_path).unwrap() {
15 let entry = entry.unwrap();
16 let path = src_path.join(entry.file_name());
17 println!("cargo:rerun-if-changed={}", path.to_str().unwrap());
18 }
19
20 config
21 .flag_if_supported("-std=c11")
22 .flag_if_supported("-fvisibility=hidden")
23 .flag_if_supported("-Wshadow")
24 .flag_if_supported("-Wno-unused-parameter")
25 .flag_if_supported("-Wno-incompatible-pointer-types")
26 .include(&src_path)
27 .include(&include_path)
28 .define("_POSIX_C_SOURCE", "200112L")
29 .define("_DEFAULT_SOURCE", None)
30 .warnings(false)
31 .file(src_path.join("lib.c"))
32 .compile("tree-sitter");
33 }