Skip to content

Commit 3465dde

Browse files
committed
fixup! grpc-sys: Use grpc headers found by pkgconfig.
1 parent 2c15028 commit 3465dde

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

grpc-sys/build.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ fn bindgen_grpc(file_path: &PathBuf, grpc_include_dir: &PathBuf) {
281281

282282
// Search header files with API interface
283283
let mut headers = Vec::new();
284-
for result in WalkDir::new(grpc_include_dir) {
284+
for result in WalkDir::new(grpc_include_dir.join("grpc")) {
285285
let dent = result.expect("Error happened when search headers");
286286
if !dent.file_type().is_file() {
287287
continue;
@@ -344,7 +344,7 @@ fn bindgen_grpc(file_path: &PathBuf, grpc_include_dir: &PathBuf) {
344344
// Determine if need to update bindings. Supported platforms do not
345345
// need to be updated by default unless the UPDATE_BIND is specified.
346346
// Other platforms use bindgen to generate the bindings every time.
347-
fn config_binding_path(#[allow(unused_variables)] grpc_include_dir: &PathBuf) {
347+
fn config_binding_path(_grpc_include_dir: &PathBuf) {
348348
let target = env::var("TARGET").unwrap();
349349
let file_path: PathBuf = match target.as_str() {
350350
"x86_64-unknown-linux-gnu" | "aarch64-unknown-linux-gnu" => {
@@ -359,7 +359,7 @@ fn config_binding_path(#[allow(unused_variables)] grpc_include_dir: &PathBuf) {
359359

360360
#[cfg(feature = "use-bindgen")]
361361
if env::var("UPDATE_BIND").is_ok() {
362-
bindgen_grpc(&file_path, grpc_include_dir);
362+
bindgen_grpc(&file_path, _grpc_include_dir);
363363
}
364364

365365
file_path
@@ -368,7 +368,7 @@ fn config_binding_path(#[allow(unused_variables)] grpc_include_dir: &PathBuf) {
368368
let file_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("grpc-bindings.rs");
369369

370370
#[cfg(feature = "use-bindgen")]
371-
bindgen_grpc(&file_path, grpc_include_dir);
371+
bindgen_grpc(&file_path, _grpc_include_dir);
372372

373373
file_path
374374
}
@@ -406,14 +406,14 @@ fn main() {
406406
let grpc_include_dir = lib_core
407407
.include_paths
408408
.iter()
409-
.map(|inc_path| inc_path.join("grpc"))
410409
.find(|grpc_inc_path| grpc_inc_path.is_dir())
411410
.unwrap_or_else(|| {
412411
panic!(
413412
"Could not find grpc include dir in {:#?}",
414413
lib_core.include_paths
415414
)
416-
});
415+
})
416+
.into();
417417
for inc_path in lib_core.include_paths {
418418
cc.include(inc_path);
419419
}

0 commit comments

Comments
 (0)