From be2ddb4811fa6b12a8fc3ef96450f6ad973ecdac Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Thu, 21 Mar 2024 11:48:28 -0400 Subject: [PATCH] Also emit DEP_ZLIB_INCLUDE when using pkg-config --- build.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 9bc2d04d..e00ae65a 100644 --- a/build.rs +++ b/build.rs @@ -35,7 +35,16 @@ fn main() { .print_system_libs(false) .probe("zlib"); match zlib { - Ok(_) => return, + Ok(zlib) => { + if !zlib.include_paths.is_empty() { + let paths = zlib + .include_paths + .iter() + .map(|s| s.display().to_string()) + .collect::>(); + println!("cargo:include={}", paths.join(",")); + } + } Err(e) => { println!("cargo-warning={}", e.to_string()) }