Skip to content

Commit

Permalink
tool_version
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Jun 14, 2024
1 parent 6084127 commit 5537fe1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 22 deletions.
4 changes: 0 additions & 4 deletions crates/libs/version/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ targets = []
[dependencies.windows-targets]
version = "0.52.5"
path = "../targets"

[dev-dependencies.windows-bindgen]
version = "0.57.0"
path = "../bindgen"
18 changes: 0 additions & 18 deletions crates/libs/version/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
8 changes: 8 additions & 0 deletions crates/tools/version/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "tool_version"
version = "0.0.0"
edition = "2021"
publish = false

[dependencies]
windows-bindgen = { path = "../../libs/bindgen" }
7 changes: 7 additions & 0 deletions crates/tools/version/src/bindings.txt
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions crates/tools/version/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use windows_bindgen::*;

fn main() -> Result<()> {
bindgen(["--etc", "crates/tools/version/src/bindings.txt"])?;
Ok(())
}

0 comments on commit 5537fe1

Please sign in to comment.