diff --git a/crates/libs/version/Cargo.toml b/crates/libs/version/Cargo.toml index e27026f8b2..15e2b91ec2 100644 --- a/crates/libs/version/Cargo.toml +++ b/crates/libs/version/Cargo.toml @@ -20,7 +20,3 @@ targets = [] [dependencies.windows-targets] version = "0.52.5" path = "../targets" - -[dev-dependencies.windows-bindgen] -version = "0.57.0" -path = "../bindgen" diff --git a/crates/libs/version/src/lib.rs b/crates/libs/version/src/lib.rs index ecb127449f..23ba99ee09 100644 --- a/crates/libs/version/src/lib.rs +++ b/crates/libs/version/src/lib.rs @@ -116,22 +116,4 @@ mod test { assert!(OsVersion::current() >= OsVersion::new(10, 100, 1_000, 10_000)); assert!(!(OsVersion::current() >= OsVersion::new(10, 100, 1_000, 10_001))); } - - #[test] - fn bindgen() { - let args = [ - "--out", - "src/bindings.rs", - "--config", - "flatten", - "sys", - "no-bindgen-comment", - "--filter", - "Windows.Wdk.System.SystemServices.RtlGetVersion", - "Windows.Win32.System.SystemInformation.OSVERSIONINFOEXW", - "Windows.Win32.System.SystemServices.VER_NT_WORKSTATION", - ]; - - windows_bindgen::bindgen(args).unwrap(); - } } diff --git a/crates/tools/version/Cargo.toml b/crates/tools/version/Cargo.toml new file mode 100644 index 0000000000..1a524f4055 --- /dev/null +++ b/crates/tools/version/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "tool_version" +version = "0.0.0" +edition = "2021" +publish = false + +[dependencies] +windows-bindgen = { path = "../../libs/bindgen" } diff --git a/crates/tools/version/src/bindings.txt b/crates/tools/version/src/bindings.txt new file mode 100644 index 0000000000..555ec9326f --- /dev/null +++ b/crates/tools/version/src/bindings.txt @@ -0,0 +1,7 @@ +--out crates/libs/version/src/bindings.rs +--config flatten sys no-bindgen-comment + +--filter + Windows.Wdk.System.SystemServices.RtlGetVersion + Windows.Win32.System.SystemInformation.OSVERSIONINFOEXW + Windows.Win32.System.SystemServices.VER_NT_WORKSTATION diff --git a/crates/tools/version/src/main.rs b/crates/tools/version/src/main.rs new file mode 100644 index 0000000000..575b7d60b0 --- /dev/null +++ b/crates/tools/version/src/main.rs @@ -0,0 +1,6 @@ +use windows_bindgen::*; + +fn main() -> Result<()> { + bindgen(["--etc", "crates/tools/version/src/bindings.txt"])?; + Ok(()) +}