Generate C header file on cargo build

This commit is contained in:
Pekka Enberg
2023-05-09 10:04:14 +03:00
parent d5b96d5edf
commit 124446f17c
3 changed files with 14 additions and 1 deletions

View File

@@ -1,2 +1,3 @@
target/
Cargo.lock
bindings/c/include
target/

View File

@@ -0,0 +1,6 @@
use std::path::Path;
fn main() {
let header_file = Path::new("include").join("mvcc.h");
cbindgen::generate(".").expect("Failed to generate C bindings").write_to_file(header_file);
}

View File

@@ -0,0 +1,6 @@
language = "C"
cpp_compat = true
include_guard = "MVCC_H"
line_length = 120
no_includes = true
style = "type"