Skip to content

Commit

Permalink
impl Iteratorimpl IntoIterator (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip authored Apr 3, 2023
1 parent d1501da commit 4a81257
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/open_jtalk-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,25 @@ fn main() {
let lib_dir = dst_dir.join("lib");
println!("cargo:rustc-link-search={}", lib_dir.to_str().unwrap());
println!("cargo:rustc-link-lib=openjtalk");
generate_bindings(dst_dir.join("include"), include_dirs.iter());
generate_bindings(dst_dir.join("include"), include_dirs);
}

#[cfg(not(feature = "generate-bindings"))]
#[allow(unused_variables)]
fn generate_bindings(
allow_dir: impl AsRef<Path>,
include_dirs: impl Iterator<Item = impl AsRef<Path>>,
include_dirs: impl IntoIterator<Item = impl AsRef<Path>>,
) {
}

#[cfg(feature = "generate-bindings")]
fn generate_bindings(
allow_dir: impl AsRef<Path>,
include_dirs: impl Iterator<Item = impl AsRef<Path>>,
include_dirs: impl IntoIterator<Item = impl AsRef<Path>>,
) {
let include_dir = allow_dir.as_ref();
let clang_args = include_dirs
.into_iter()
.map(|dir| format!("-I{}", dir.as_ref().to_str().unwrap()))
.chain([format!("-I{}", include_dir.to_str().unwrap())])
.collect::<Vec<_>>();
Expand Down

0 comments on commit 4a81257

Please sign in to comment.