-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use cbindgen library instead of CLI (#2)
* add cbindgen to build dependencies * use cbindgen rust-style rather then via command * comment out doc length line which causes error Couldn't parse config file: unknown field `documentation_length`
- Loading branch information
1 parent
96c616a
commit c8a280e
Showing
3 changed files
with
11 additions
and
16 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
// Jackson Coxson | ||
|
||
use std::process::Command; | ||
use std::env; | ||
use cbindgen; | ||
|
||
fn main() { | ||
// Generate the cbindings | ||
let _ = if cfg!(target_os = "windows") { | ||
Command::new("cmd") | ||
.args(["/C", "cbindgen -c cbindgen.toml -o em_proxy.h"]) | ||
.output() | ||
.expect("Failed to generate c bindings") | ||
} else { | ||
Command::new("sh") | ||
.arg("-c") | ||
.arg("cbindgen -c cbindgen.toml -o em_proxy.h") | ||
.output() | ||
.expect("Failed to generate c bindings") | ||
}; | ||
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); | ||
|
||
cbindgen::generate(crate_dir) | ||
.expect("Unable to generate C bindings") | ||
.write_to_file("em_proxy.h"); | ||
} |
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