microsoft / windows-rs

Rust for Windows
https://kennykerr.ca/rust-getting-started/
Apache License 2.0
10.36k stars 486 forks source link

Add `cppwinrt` crate and sample #3054

Closed kennykerr closed 4 months ago

kennykerr commented 4 months ago

Building on #3046, this update introduces the new cppwinrt crate that bundles the C++/WinRT compiler for use in Rust. It just makes it super easy to generate C++/WinRT headers directly from Rust:

[dependencies.cppwinrt]
version = "0.1"
fn main() {
    match cppwinrt::cppwinrt(["-help"]) {
        Ok(output) => println!("{output}"),
        Err(error) => println!("{error}"),
    };
}