8000 fix: do not rerun build on changed header files · edgenai/llama_cpp-rs@674f395 · GitHub
[go: up one dir, main page]

Skip to content

Commit 674f395

Browse files
committed
fix: do not rerun build on changed header files
this restores functionality lost in the latest upgrade to `bindgen`, which enabled this functionality
1 parent 3a70922 commit 674f395

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

crates/llama_cpp_sys/build.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ fn main() {
6161
}
6262

6363
if !build_info_path.exists() {
64-
fs::write(build_info_path, "\
64+
fs::write(
65+
build_info_path,
66+
"\
6567
#ifndef BUILD_INFO_H
6668
#define BUILD_INFO_H
6769
@@ -72,7 +74,9 @@ fn main() {
7274
7375
#endif // BUILD_INFO_H
7476
75-
").unwrap();
77+
",
78+
)
79+
.unwrap();
7680
}
7781

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

8993
let bindings = bindgen::Builder::default()
9094
.header(header_path.to_string_lossy())
91-
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
95+
.parse_callbacks(Box::new(
96+
bindgen::CargoCallbacks::new().rerun_on_header_files(false),
97+
))
9298
.generate_comments(false)
9399
.allowlist_function("llama_.*")
94100
.allowlist_type("llama_.*")

0 commit comments

Comments
 (0)
0