MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / generate_ml_module_binding

Function generate_ml_module_binding

rust_package/brainflow/build.rs:65–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64#[cfg(feature = "generate_binding")]
65fn generate_ml_module_binding() {
66 const ALLOW_UNCONVENTIONALS: &'static str = "#![allow(non_camel_case_types)]\n";
67
68 let header_path = PathBuf::from("inc");
69 let header_path = header_path.display();
70
71 let bindings = bindgen::Builder::default()
72 .header(format!("{}/ml_module.h", &header_path))
73 .raw_line(ALLOW_UNCONVENTIONALS)
74 .clang_arg("-std=c++11")
75 .clang_arg("-x")
76 .clang_arg("c++")
77 .generate()
78 .expect("Unable to generate bindings");
79
80 let binding_target_path = PathBuf::new().join("src").join("ffi").join("ml_module.rs");
81
82 bindings
83 .write_to_file(binding_target_path.clone())
84 .expect("Could not write binding to `src/ffi/ml_module.rs`");
85}
86
87#[cfg(feature = "generate_binding")]
88fn generate_constants_binding() {

Callers 1

generate_bindingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected