From 3506538752662a6318f44706c67b0bcefb83af42 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 14 Aug 2026 12:11:46 +0000 Subject: [PATCH] Enable WebP SIMD for Windows builds. --- Cargo.lock | 1 + Cargo.toml | 1 + crates/bds-core/Cargo.toml | 7 ++++++- crates/bds-ui/tests/packaging_assets.rs | 6 ++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index aeb7275..1256d05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1148,6 +1148,7 @@ dependencies = [ "image", "keyring", "libsqlite3-sys", + "libwebp-sys", "liquid", "liquid-core", "md5 0.8.1", diff --git a/Cargo.toml b/Cargo.toml index 58db38a..6acaa79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ futures = "0.3" image = "0.25" hpvcd = "0.3.1" webp = { version = "0.3.1", default-features = false } +libwebp-sys = { version = "0.9.6", default-features = false } rust-stemmers = "1" sys-locale = "0.3" fluent-bundle = "0.16" diff --git a/crates/bds-core/Cargo.toml b/crates/bds-core/Cargo.toml index 18a0c42..6092d25 100644 --- a/crates/bds-core/Cargo.toml +++ b/crates/bds-core/Cargo.toml @@ -50,6 +50,11 @@ ort = { workspace = true } [target.'cfg(target_os = "macos")'.dependencies] usearch = { workspace = true } +[target.'cfg(target_os = "windows")'.dependencies] +# libwebp's MSVC autodetection enables SSE 4.1 sources, so clang-cl must +# compile them with the matching target feature during cargo-xwin builds. +libwebp-sys = { workspace = true, features = ["sse41"] } + [target.'cfg(not(target_os = "macos"))'.dependencies] usearch = { workspace = true, features = ["numkong"] } @@ -57,4 +62,4 @@ usearch = { workspace = true, features = ["numkong"] } tempfile = "3" [package.metadata.cargo-machete] -ignored = ["libsqlite3-sys"] +ignored = ["libsqlite3-sys", "libwebp-sys"] diff --git a/crates/bds-ui/tests/packaging_assets.rs b/crates/bds-ui/tests/packaging_assets.rs index cb9ad52..764d56b 100644 --- a/crates/bds-ui/tests/packaging_assets.rs +++ b/crates/bds-ui/tests/packaging_assets.rs @@ -61,10 +61,16 @@ fn desktop_packages_have_native_icons_and_cargo_commands() { assert!(workspace_manifest.contains("strip = \"symbols\"")); assert!(workspace_manifest.contains("ort-download-binaries-rustls-tls")); assert!(workspace_manifest.contains("\"sync-secret-service\", \"vendored\"")); + assert!( + workspace_manifest + .contains("libwebp-sys = { version = \"0.9.6\", default-features = false }") + ); let core_manifest = fs::read_to_string(Path::new(CRATE_DIR).join("../bds-core/Cargo.toml")).unwrap(); assert!(core_manifest.contains("crate-type = [\"dylib\"]")); + assert!(core_manifest.contains("[target.'cfg(target_os = \"windows\")'.dependencies]")); + assert!(core_manifest.contains("libwebp-sys = { workspace = true, features = [\"sse41\"] }")); let server_manifest = fs::read_to_string(Path::new(CRATE_DIR).join("../bds-server/Cargo.toml")).unwrap(); assert!(server_manifest.contains("crate-type = [\"dylib\"]"));