Skip to content

Commit

Permalink
Merge pull request #9 from binedge/nits
Browse files Browse the repository at this point in the history
Do not rerun llama_cpp_sys build on changed header files
  • Loading branch information
scriptis authored Nov 8, 2023
2 parents 115fba6 + 674f395 commit 47c7a1a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/llama_cpp_sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ fn main() {
}

if !build_info_path.exists() {
fs::write(build_info_path, "\
fs::write(
build_info_path,
"\
#ifndef BUILD_INFO_H
#define BUILD_INFO_H
Expand All @@ -72,7 +74,9 @@ fn main() {
#endif // BUILD_INFO_H
").unwrap();
",
)
.unwrap();
}

let dst = cmake::Config::new(&build_dir)
Expand All @@ -88,7 +92,9 @@ fn main() {

let bindings = bindgen::Builder::default()
.header(header_path.to_string_lossy())
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.parse_callbacks(Box::new(
bindgen::CargoCallbacks::new().rerun_on_header_files(false),
))
.generate_comments(false)
.allowlist_function("llama_.*")
.allowlist_type("llama_.*")
Expand Down

0 comments on commit 47c7a1a

Please sign in to comment.