From 7833532fc4c1facfa704f5f6ac985c9dbec54023 Mon Sep 17 00:00:00 2001 From: Scott Hutton Date: Tue, 9 Jan 2024 10:52:41 -0800 Subject: [PATCH] clamav-sys: Fix up Windows build --- clamav-sys/build.rs | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/clamav-sys/build.rs b/clamav-sys/build.rs index 3560260371..82aab78ea0 100644 --- a/clamav-sys/build.rs +++ b/clamav-sys/build.rs @@ -165,8 +165,11 @@ fn cargo_common() { println!("cargo:rerun-if-changed=wrapper.h"); } -#[cfg(windows)] -pub fn main() { +fn main() -> anyhow::Result<()> { + #[cfg(not(windows))] + let mut include_paths = vec![]; + + #[cfg(windows)] let include_paths = match vcpkg::find_package("clamav") { Ok(pkg) => pkg.include_paths, Err(err) => { @@ -198,20 +201,6 @@ pub fn main() { } }; - cargo_common(); - generate_bindings(&|x: bindgen::Builder| -> bindgen::Builder { - let mut x = x; - for include_path in &include_paths { - x = x.clang_arg("-I").clang_arg(include_path.to_str().unwrap()); - } - x - }); -} - -#[cfg(unix)] -fn main() -> anyhow::Result<()> { - let mut include_paths = vec![]; - let mut output_path_intmod = PathBuf::from(env::var("OUT_DIR")?); output_path_intmod.push("sys.rs");