diff --git a/crates/tools/core/Cargo.toml b/crates/tools/core/Cargo.toml index 7873a2312d..60cf975070 100644 --- a/crates/tools/core/Cargo.toml +++ b/crates/tools/core/Cargo.toml @@ -3,3 +3,6 @@ name = "tool_core" version = "0.0.0" edition = "2021" publish = false + +[dependencies.windows-bindgen] +path = "../../libs/bindgen" diff --git a/crates/tools/core/bindings.txt b/crates/tools/core/bindings.txt index 0eff676319..8a80cce870 100644 --- a/crates/tools/core/bindings.txt +++ b/crates/tools/core/bindings.txt @@ -1,6 +1,5 @@ ---in crates/libs/metadata/default --out crates/libs/core/src/imp/bindings.rs ---config FLATTEN SYS MINIMAL +--config flatten sys minimal --filter Windows.Win32.Foundation.CloseHandle diff --git a/crates/tools/core/com_bindings.txt b/crates/tools/core/com_bindings.txt index b8b9f7bbca..ae1915477c 100644 --- a/crates/tools/core/com_bindings.txt +++ b/crates/tools/core/com_bindings.txt @@ -1,6 +1,5 @@ ---in crates/libs/metadata/default --out crates/libs/core/src/imp/com_bindings.rs ---config FLATTEN MINIMAL +--config flatten minimal --filter Windows.Foundation.IReference diff --git a/crates/tools/core/src/main.rs b/crates/tools/core/src/main.rs index d0b8163d0b..013d58cce0 100644 --- a/crates/tools/core/src/main.rs +++ b/crates/tools/core/src/main.rs @@ -1,27 +1,7 @@ -fn main() { - let mut command = std::process::Command::new("cargo"); +use windows_bindgen::*; - command.args([ - "run", - "-p", - "riddle", - "--", - "--etc", - "crates/tools/core/bindings.txt", - ]); - - assert!(command.status().unwrap().success()); - - let mut command = std::process::Command::new("cargo"); - - command.args([ - "run", - "-p", - "riddle", - "--", - "--etc", - "crates/tools/core/com_bindings.txt", - ]); - - assert!(command.status().unwrap().success()); +fn main() -> Result<()> { + bindgen(["--etc", "crates/tools/core/bindings.txt"])?; + bindgen(["--etc", "crates/tools/core/com_bindings.txt"])?; + Ok(()) }