From 5093d2bd68912ba56c7ac78920a8dd4a44e7a830 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Fri, 14 Jun 2024 13:56:03 -0500 Subject: [PATCH] tool_sys --- crates/tools/sys/Cargo.toml | 3 +++ crates/tools/sys/{ => src}/bindings.txt | 1 - crates/tools/sys/src/main.rs | 16 ++++------------ 3 files changed, 7 insertions(+), 13 deletions(-) rename crates/tools/sys/{ => src}/bindings.txt (99%) diff --git a/crates/tools/sys/Cargo.toml b/crates/tools/sys/Cargo.toml index e82c2b0f18..72bd0217d0 100644 --- a/crates/tools/sys/Cargo.toml +++ b/crates/tools/sys/Cargo.toml @@ -3,3 +3,6 @@ name = "tool_sys" version = "0.0.0" edition = "2021" publish = false + +[dependencies] +windows-bindgen = { path = "../../libs/bindgen" } diff --git a/crates/tools/sys/bindings.txt b/crates/tools/sys/src/bindings.txt similarity index 99% rename from crates/tools/sys/bindings.txt rename to crates/tools/sys/src/bindings.txt index 7f6a6b5dfa..03939d4f86 100644 --- a/crates/tools/sys/bindings.txt +++ b/crates/tools/sys/src/bindings.txt @@ -1,4 +1,3 @@ ---in crates/libs/bindgen/default --out crates/libs/sys/src/lib.rs --config package sys no-bindgen-comment --config rustfmt-config=max_width=800,newline_style=Unix diff --git a/crates/tools/sys/src/main.rs b/crates/tools/sys/src/main.rs index b9cc3008bf..6a126b1942 100644 --- a/crates/tools/sys/src/main.rs +++ b/crates/tools/sys/src/main.rs @@ -1,14 +1,6 @@ -fn main() { - let mut command = std::process::Command::new("cargo"); +use windows_bindgen::*; - command.args([ - "run", - "-p", - "riddle", - "--", - "--etc", - "crates/tools/sys/bindings.txt", - ]); - - assert!(command.status().unwrap().success()); +fn main() -> Result<()> { + bindgen(["--etc", "crates/tools/sys/src/bindings.txt"])?; + Ok(()) }