arnaucube
arnaucube/poulpyPublic Self-hosted repository
poulpy/base2k/src/bindgen.rs
base2k/src/bindgen.rsRaw
 1/*
 2[build-dependencies]
 3bindgen ="0.71.1"
 4
 5//use bindgen;
 6//use std::env;
 7//use std::fs;
 8//use std::path::PathBuf;
 9//use std::time::SystemTime;
10
11// Path to the C header file
12let header_paths: [&str; 2] = [
13    "spqlios-arithmetic/spqlios/coeffs/coeffs_arithmetic.h",
14    "spqlios-arithmetic/spqlios/arithmetic/vec_znx_arithmetic.h",
15];
16
17let out_path: PathBuf = PathBuf::from(env::var("OUT_DIR").unwrap());
18let bindings_file = out_path.join("bindings.rs");
19
20let mut builder: bindgen::Builder = bindgen::Builder::default();
21for header in header_paths {
22    builder = builder.header(header);
23}
24
25let bindings = builder
26    .generate_comments(false) // Optional: includes comments in bindings
27    .generate_inline_functions(true) // Optional: includes inline functions
28    .generate()
29    .expect("Unable to generate bindings");
30
31// Write the bindings to the OUT_DIR
32bindings
33    .write_to_file(&bindings_file)
34    .expect("Couldn't write bindings!");
35
36*/