Skip to content

Commit

Permalink
riddle
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Nov 15, 2023
1 parent 93064ed commit 0a48da6
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
6 changes: 6 additions & 0 deletions crates/tests/readme/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ features = [
"Win32_System_Threading",
"Win32_UI_WindowsAndMessaging",
]

[dependencies.windows-targets]
path = "../../libs/targets"

[dependencies.windows-metadata]
path = "../../libs/metadata"
1 change: 0 additions & 1 deletion crates/tests/readme/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![doc = include_str!("../../../../crates/libs/bindgen/readme.md")]
#![doc = include_str!("../../../../crates/libs/core/readme.md")]
#![doc = include_str!("../../../../crates/libs/metadata/readme.md")]
#![doc = include_str!("../../../../crates/libs/sys/readme.md")]
Expand Down
3 changes: 2 additions & 1 deletion crates/tools/riddle/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "riddle"
version = "0.0.1"
version = "0.1.0"
authors = ["Microsoft"]
edition = "2021"
rust-version = "1.56"
license = "MIT OR Apache-2.0"
description = "Windows metadata compiler"
repository = "https://github.com/microsoft/windows-rs"
readme = "readme.md"

[dependencies.windows-bindgen]
path = "../../libs/bindgen"
Expand Down
28 changes: 28 additions & 0 deletions crates/tools/riddle/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Generate Rust bindings for Windows

The [riddle](https://crates.io/crates/riddle) tool automatically generates Rust bindings from Windows metadata.

* [Getting started](https://kennykerr.ca/rust-getting-started/)
* [Samples](https://github.com/microsoft/windows-rs/tree/0.52.0/crates/samples) <!-- link to samples for upcoming release -->
* [Releases](https://github.com/microsoft/windows-rs/releases)

Start by installing `riddle`:

```
> cargo install riddle
```

Generates Rust bindings as needed:

```
> riddle
Usage: riddle.exe [options...]
Options:
--in <path> Path to files and directories containing .winmd and .rdl files
--out <path> Path to .winmd, .rdl, or .rs file to generate
--filter <namespace> Namespaces to include or !exclude in output
--config <key=value> Override a configuration value
--format Format .rdl files only
--etc <path> File containing command line options
```

0 comments on commit 0a48da6

Please sign in to comment.