servicepoint/servicepoint2/build.rs

20 lines
499 B
Rust
Raw Normal View History

2024-05-12 17:15:30 +02:00
extern crate cbindgen;
use std::env;
use cbindgen::Language;
fn main() {
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
2024-05-12 18:28:53 +02:00
println!("cargo:rerun-if-changed=src");
2024-05-12 17:15:30 +02:00
cbindgen::Builder::new()
.with_crate(crate_dir)
.with_item_prefix("sp2_")
.with_language(Language::C)
2024-05-12 18:28:53 +02:00
.with_cpp_compat(true)
.with_parse_expand_all_features(true)
2024-05-12 17:15:30 +02:00
.generate()
.expect("Unable to generate bindings")
2024-05-12 18:28:53 +02:00
.write_to_file("sp2-bindings.h");
2024-05-12 17:15:30 +02:00
}