Skip to content

Commit

Permalink
clamav-sys: Fix up Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
shutton committed Jan 9, 2024
1 parent a1fa8e4 commit 7833532
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions clamav-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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");

Expand Down

0 comments on commit 7833532

Please sign in to comment.