From fcc6be2b01fd0b88c1d0449162e17b44b4d1d7c7 Mon Sep 17 00:00:00 2001 From: Maximilian Hristache Date: Sat, 28 Nov 2015 16:24:08 +0100 Subject: [PATCH] Avoid empty include paths (i.e. cc -I "" ) as they are not supported by GCC. Fix #311 --- openssl-sys/build.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openssl-sys/build.rs b/openssl-sys/build.rs index d8399c54..0e3a76d2 100644 --- a/openssl-sys/build.rs +++ b/openssl-sys/build.rs @@ -15,8 +15,11 @@ fn main() { // rustc doesn't seem to work with pkg-config's output in mingw64 if !target.contains("windows") { if let Ok(info) = pkg_config::find_library("openssl") { - let paths = env::join_paths(info.include_paths).unwrap(); - println!("cargo:include={}", paths.to_str().unwrap()); + // avoid empty include paths as they are not supported by GCC + if info.include_paths.len() > 0 { + let paths = env::join_paths(info.include_paths).unwrap(); + println!("cargo:include={}", paths.to_str().unwrap()); + } return; } }