Automatically generate header with cbindgen

This commit is contained in:
Jackson Coxson
2025-03-24 15:30:39 -06:00
parent f3761a5d44
commit 7f93b664d4
2 changed files with 38 additions and 0 deletions

18
ffi/build.rs Normal file
View File

@@ -0,0 +1,18 @@
// Jackson Coxson
use std::env;
fn main() {
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
cbindgen::Builder::new()
.with_crate(crate_dir)
.with_header(
"// Jackson Coxson\n// Bindings to idevice - https://github.com/jkcoxson/idevice",
)
.with_language(cbindgen::Language::C)
.with_sys_include("sys/socket.h")
.generate()
.expect("Unable to generate bindings")
.write_to_file("idevice.h");
}