Skip to content

Commit

Permalink
build.rs: update to not use case-insensitive regex
Browse files Browse the repository at this point in the history
  • Loading branch information
eNV25 committed May 15, 2024
1 parent 15f297b commit 8b33168
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
use std::{env, error, path::Path};

fn main() -> Result<(), Box<dyn error::Error>> {
const MPV_SYMBOLS: &str = "(?i:mpv_).*";
const MPV_SYMBOLS: &str = "(MPV|mpv)_.*";
let header = Path::new(&pkg_config::get_variable("mpv", "includedir")?).join("mpv/client.h");
let header = <&str>::try_from(header.as_os_str())?;
let output = Path::new(&env::var("OUT_DIR")?).join("ffi.rs");
bindgen::builder()
.header(header)
.clang_arg("-Wp,-D_FORTIFY_SOURCE=2")
.clang_arg("-Wp,-DMPV_ENABLE_DEPRECATED=0")
.impl_debug(true)
.allowlist_var(MPV_SYMBOLS)
.allowlist_type(MPV_SYMBOLS)
.allowlist_function(MPV_SYMBOLS)
.opaque_type("mpv_handle")
.allowlist_item(MPV_SYMBOLS)
.constified_enum(MPV_SYMBOLS)
.prepend_enum_name(false)
.opaque_type("mpv_handle")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.generate()?
.write_to_file(output)?;
Expand Down

0 comments on commit 8b33168

Please sign in to comment.