mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Also update version numbers of binding Rust projects to match Regorus Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
33 lines
917 B
Rust
33 lines
917 B
Rust
extern crate cbindgen;
|
|
extern crate csbindgen;
|
|
|
|
use std::env;
|
|
|
|
fn main() {
|
|
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
|
|
cbindgen::Builder::new()
|
|
.with_crate(&crate_dir)
|
|
.with_language(cbindgen::Language::C)
|
|
.with_include_guard("REGORUS_H")
|
|
.generate()
|
|
.expect("Unable to generate bindings")
|
|
.write_to_file("regorus.h");
|
|
|
|
cbindgen::Builder::new()
|
|
.with_crate(crate_dir)
|
|
.with_language(cbindgen::Language::Cxx)
|
|
.with_include_guard("REGORUS_FFI_HPP")
|
|
.generate()
|
|
.expect("Unable to generate bindings")
|
|
.write_to_file("regorus.ffi.hpp");
|
|
|
|
csbindgen::Builder::default()
|
|
.input_extern_file("src/lib.rs")
|
|
.csharp_dll_name("regorus_ffi")
|
|
.csharp_class_name("API")
|
|
.csharp_namespace("RegorusFFI")
|
|
.generate_csharp_file("./RegorusFFI.g.cs")
|
|
.unwrap();
|
|
}
|