-
Notifications
You must be signed in to change notification settings - Fork 6
Add Larod #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Larod #120
Changes from 71 commits
151cd8c
8d3defa
709d58c
e158693
024e491
56d3720
51e2518
3d510b6
3e004a0
021ea65
f9e0506
c05a0a1
e0fa140
147e438
32db020
b3607bf
a5d62d5
4309ed6
de2367b
1dc6896
55a7158
b294ca3
bdeda81
1eb3252
7941c92
59b9ac5
4373b18
cdaf42b
ff868cb
0382a94
c03e898
300af7e
4b2f2cb
486757a
714a8bd
60b770f
ec86ed3
2380e9c
c3a87f4
ae1384c
0eea902
d6a0e22
63e4875
9be7b76
65de920
682cb21
670fb23
845fadb
44e00d7
620808d
fff440f
9c96b53
295dfc8
90430cc
6aa9c1e
36eb55a
96b2918
98dbb90
0b43dd0
c62919c
f58fd53
67f1602
e19217a
b80c40b
e378419
56f42f6
b196e7e
f3f7adb
2a0642f
01f4966
43ed182
8453d8f
96b0917
3b28782
79f6a7e
547bf88
10ab960
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
build = "build.rs" | ||
name = "larod-sys" | ||
version = "0.1.0" | ||
edition.workspace = true | ||
|
||
JsGjKJzi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[build-dependencies] | ||
bindgen = { workspace = true } | ||
pkg-config = { workspace = true } | ||
|
||
[dependencies] | ||
thiserror = { workspace = true } | ||
JsGjKJzi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use std::{env, path}; | ||
|
||
fn populated_bindings(dst: &path::PathBuf) { | ||
let library = pkg_config::Config::new().probe("liblarod").unwrap(); | ||
let mut bindings = bindgen::Builder::default() | ||
.header("wrapper.h") | ||
.allowlist_recursively(false) | ||
.allowlist_function("^(larod.*)$") | ||
.allowlist_type("^(_?larod.*)$") | ||
.default_enum_style(bindgen::EnumVariation::Rust { | ||
|
||
non_exhaustive: true, | ||
}) | ||
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) | ||
.layout_tests(false); | ||
for path in library.include_paths { | ||
bindings = bindings.clang_args(&["-F", path.to_str().unwrap()]); | ||
} | ||
bindings.generate().unwrap().write_to_file(dst).unwrap(); | ||
} | ||
|
||
fn main() { | ||
let dst = path::PathBuf::from(env::var("OUT_DIR").unwrap()).join("bindings.rs"); | ||
if env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default() != "x86_64" { | ||
populated_bindings(&dst); | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.