Skip to content
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

impl Iteratorimpl IntoIterator #11

Merged
merged 2 commits into from
Apr 3, 2023
Merged
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
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