Created
October 12, 2018 06:55
-
-
Save yushulx/ebec15324dfd8c257c33cb8bfcd13d70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate bindgen; | |
fn main() { | |
// Generates Rust FFI bindings. | |
let bindings = bindgen::Builder::default() | |
// The input header we would like to generate | |
// bindings for. | |
.header("src/bridge.h") | |
// Finish the builder and generate the bindings. | |
.generate() | |
// Unwrap the Result and panic on failure. | |
.expect("Unable to generate bindings"); | |
bindings | |
.write_to_file("src/bridge.rs") | |
.expect("Couldn't write bindings!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment