Skip to content
Open
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
12 changes: 10 additions & 2 deletions rlottie-sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
use std::{env, path::PathBuf};

fn main() {
pkg_config::Config::new()
let rlottie_pkg = pkg_config::Config::new()
.probe("rlottie")
.expect("Unable to find rlottie");


// Extract include paths from the pkg-config metadata
let include_args: Vec<String> = rlottie_pkg
.include_paths
.iter()
.map(|path| format!("-I{}", path.display()))
.collect();

println!("cargo:rerun-if-changed=wrapper.h");
let bindings = bindgen::Builder::default()
.formatter(bindgen::Formatter::Prettyplease)
.header("wrapper.h")
.clang_args(&include_args) // Add include paths
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.newtype_enum(".*")
.size_t_is_usize(true)
Expand Down
Loading