cad-editor/crates/dwg-thumbnailer-win/Cargo.toml
Hakan Seven 3c57260ddb fix(thumbnailer-win): make the COM DLL compile on the MSVC target
First real Windows build surfaced errors that a Linux host couldn't catch:

* Enable the missing `windows` feature gates (Win32_System_LibraryLoader,
  Win32_System_SystemServices, Win32_Security — the last brings in the
  `Ex` registry APIs) so the imports resolve.
* Depend on `windows-core`: the `#[implement]` macro expands to
  `windows_core::` paths, which need the crate nameable in the root.
* `IClassFactory::LockServer` takes `Win32::Foundation::BOOL`, not a
  `core` BOOL.
* Name the returned image type via a new `dwg_thumbnailer::RgbaImage`
  re-export instead of a direct `image` dependency.

Verified with `cargo check --target x86_64-pc-windows-gnu -p
dwg-thumbnailer-win` (and the native check still passes).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 02:11:22 +03:00

32 lines
1 KiB
TOML

[package]
name = "dwg-thumbnailer-win"
version = "0.1.0"
edition = "2021"
description = "Windows Explorer thumbnail handler (IThumbnailProvider) for DWG files"
license = "MIT OR Apache-2.0"
# A COM in-proc server DLL. Off Windows this compiles to an empty cdylib so the
# workspace still builds on Linux/macOS; the real handler is cfg(windows) only.
[lib]
crate-type = ["cdylib"]
[dependencies]
dwg_thumbnailer = { package = "dwg-thumbnailer", path = "../dwg-thumbnailer" }
[target.'cfg(windows)'.dependencies]
# `#[implement]` expands to `windows_core::` paths, so the core crate must be
# nameable in the crate root (kept in lockstep with the `windows` version).
windows-core = "0.58"
windows = { version = "0.58", features = [
"implement",
"Win32_Foundation",
"Win32_Security",
"Win32_System_Com",
"Win32_System_Com_StructuredStorage",
"Win32_System_LibraryLoader",
"Win32_System_Registry",
"Win32_System_SystemServices",
"Win32_UI_Shell",
"Win32_UI_Shell_PropertiesSystem",
"Win32_Graphics_Gdi",
] }