Skip to content

Commit

Permalink
fix: do not rerun build on changed header files
Browse files Browse the repository at this point in the history
this restores functionality lost in the latest upgrade to `bindgen`, which enabled this functionality
  • Loading branch information
scriptis committed Nov 8, 2023
1 parent 3a70922 commit 674f395
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 674f395

Please sign in to comment.