changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / rust/sys/btrfs/build.rs

changeset 698: 96958d3eb5b0
parent: 0ccbbd142694
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 //! src/sys/btrfs/build.rs --- btrfs bindgen builder
2 
3 //! Code:
4 fn main() {
5  println!("cargo:rustc-link-search=/usr/include");
6  println!("cargo:rerun-if-changed=wrapper.h");
7  let bindings = bindgen::Builder::default()
8  .header("wrapper.h")
9  .generate_comments(true)
10  .prepend_enum_name(false)
11  // .use_core()
12  .derive_default(true)
13  // .allowlist_type("btrfs.*")
14  // .allowlist_var("BTRFS.*")
15  .parse_callbacks(Box::new(bindgen::CargoCallbacks))
16  .generate()
17  .expect("Unable to generate bindings");
18  bindings
19  .write_to_file(format!(
20  "{}/{}",
21  std::env::var("OUT_DIR").unwrap(),
22  "bindings.rs"
23  ))
24  .expect("Couldn't write bindings!");
25 }