Expand description
§windows-clang
The windows-clang crate scrapes C/C++ headers with
libclang and emits RDL (Rust Definition Language) source - the text format understood by
windows-rdl. It is the header-facing front end of the Win32
metadata pipeline: headers to RDL (this crate) to .winmd (windows-rdl).
Start by adding the following to your Cargo.toml file:
[dependencies.windows-clang]
version = "0.100"Point it at one or more headers and write the resulting per-header RDL, then feed that RDL to
windows_rdl::reader() to compile a .winmd:
windows_clang::clang()
.input("Example.h")
.output("rdl")
.namespace("Example")
.write_by_header()
.unwrap();Structs§
- Arch
- Target architecture settings that differ between scrape passes.
- Clang
- Builder that generates RDL from C/C++ headers using libclang.
- Scrape
Plan - Multi-arch and output state layered on top of a configured
Clang. - Summary
- What
Clang::scrapeproduced, for the caller’s summary output.
Constants§
- LIBCLANG_
VERSION - Pinned libclang version; macro capture changes across major versions.
Functions§
- assert_
libclang_ version - Assert the loaded libclang matches
LIBCLANG_VERSION. - clang
- Creates a libclang-backed RDL generator.
- clang_
resource_ dir - Resolve the version-matched clang
-resource-dir, honoringCLANG_RESOURCE_DIR. - clang_
version - Returns the loaded libclang version string.
- ensure_
libclang - Ensure libclang is loadable, respecting an existing
LIBCLANG_PATH. - find_
in_ dirs - Find
nameindirs, returning a forward-slashed path. - libclang_
dir - Resolve or fetch the pinned host-arch
libclang.dlldirectory without setting env vars. - nuget_
package - Resolve or fetch an exact NuGet package, accepting global-cache or flat restore layouts.