-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.rs
More file actions
32 lines (27 loc) · 865 Bytes
/
build.rs
File metadata and controls
32 lines (27 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2024-2026 Andrey Vasilevsky <anvanster@gmail.com>
// SPDX-License-Identifier: Apache-2.0
fn main() {
let src_dir = std::path::Path::new("tree-sitter-cobol-src");
let mut build = cc::Build::new();
build
.include(src_dir)
.file(src_dir.join("parser.c"))
.file(src_dir.join("scanner.c"))
.warnings(false);
// For tree-sitter headers
if let Ok(ts_include_dir) = std::env::var("DEP_TREE_SITTER_INCLUDE") {
if !ts_include_dir.is_empty() {
build.include(&ts_include_dir);
}
}
build.compile("tree_sitter_cobol");
println!("cargo:rerun-if-changed=build.rs");
println!(
"cargo:rerun-if-changed={}",
src_dir.join("parser.c").display()
);
println!(
"cargo:rerun-if-changed={}",
src_dir.join("scanner.c").display()
);
}