Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ authors = ["Andrew C. Smith <[email protected]>"]
links = "bela"

[build-dependencies]
bindgen = "0.58"
bindgen = "0.63"
cc = { version = "1.0", optional = true }
doxygen-rs = { git = "https://github.com/Techie-Pi/doxygen-rs.git", rev = "a7fee318dba1939bcd6f22a7a43de1b072552d87" }

[dev-dependencies]
libc = "0.2"
nix = "0.22"
nix = "0.25"

[features]
static = []
Expand Down
13 changes: 13 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ extern crate bindgen;
use std::env;
use std::path::PathBuf;

use bindgen::callbacks::ParseCallbacks;

#[derive(Debug)]
struct DoxygenCallback;

impl ParseCallbacks for DoxygenCallback {
fn process_comment(&self, comment: &str) -> Option<String> {
Some(doxygen_rs::transform(comment))
}
}

fn main() {
let bela_root = PathBuf::from(env::var("BELA_SYSROOT").unwrap_or_else(|_| "/".into()));
let bela_include = bela_root.join("root/Bela/include");
Expand Down Expand Up @@ -44,6 +55,7 @@ fn main() {
.allowlist_function("rt_.*printf")
.allowlist_var("BELA_.*")
.allowlist_var("DEFAULT_.*")
.parse_callbacks(Box::new(DoxygenCallback))
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
Expand Down Expand Up @@ -79,6 +91,7 @@ fn main() {
.clang_arg(format!("--sysroot={}", bela_root.to_str().unwrap()))
.clang_arg(format!("-I{}", bela_include.to_str().unwrap()))
.allowlist_function("Midi_.*")
.parse_callbacks(Box::new(DoxygenCallback))
.generate()
.expect("Unable to generate bindings");
bindings
Expand Down