Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit ada58d5

Browse files
authored
Rerun build.rs if we change our kdir. (#100)
Also move a line of code to be closer to where it's used.
1 parent 4464a1d commit ada58d5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

build.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ const OPAQUE_TYPES: &[&str] = &[
4545
];
4646

4747
fn main() {
48-
let mut builder = bindgen::Builder::default()
49-
.use_core()
50-
.ctypes_prefix("c_types")
51-
.derive_default(true)
52-
.rustfmt_bindings(true);
53-
48+
println!("rerun-if-env-changed=KDIR");
5449
let output = String::from_utf8(
5550
Command::new("make")
5651
.arg("-C")
@@ -62,6 +57,12 @@ fn main() {
6257
)
6358
.unwrap();
6459

60+
let mut builder = bindgen::Builder::default()
61+
.use_core()
62+
.ctypes_prefix("c_types")
63+
.derive_default(true)
64+
.rustfmt_bindings(true);
65+
6566
builder = builder.clang_arg("--target=x86_64-linux-kernel-module");
6667
for arg in shlex::split(&output).unwrap() {
6768
builder = builder.clang_arg(arg.to_string());

0 commit comments

Comments
 (0)