# windows-drivers-rs requires UMDF drivers to link the STATIC CRT (wdk-build errors `StaticCrtNotEnabled` # otherwise, and the generated wdk-sys bindings' layout asserts only hold with it). # # Setting an EXPLICIT build target is the trick that makes `target-feature=+crt-static` apply ONLY to the # driver cdylib and NOT to host build-scripts/proc-macros (which must stay dynamic-CRT): with an explicit # --target, cargo compiles host artifacts for the implicit host and the `[target.]` rustflags # apply only to the target. The Windows host (and thus its drivers) is x64-only by design. [build] target = "x86_64-pc-windows-msvc" [target.x86_64-pc-windows-msvc] rustflags = ["-C", "target-feature=+crt-static"]