Skip to content

Project-Xent/cwinrt

Repository files navigation

cwinrt

Pure C projection for the Windows Runtime.

Build

Requires xmake on Windows.

xmake build cwinrt-rt test_smoke
xmake run test_smoke

Generator (pure C)

gen/winmd.c reads .winmd as PE + ECMA-335 #~ metadata (no cor.h / COM).

xmake build cwinrt-gen
xmake run cwinrt-gen --winmd path\to\Windows.UI.Composition.winmd -o include/cwinrt

Works with MSVC and MinGW.

Batch generation

Generates one header per Windows.* namespace from union metadata (Windows.winmd), e.g. Windows.UI.Composition.h, Windows.Graphics.Capture.h. SDK version is pinned in sdk.version; scripts read it by default.

xmake build cwinrt-gen
xmake build gen-headers          # headers only
xmake build gen-all-impl         # headers + impl/*.impl.c (~342 namespaces)
xmake build verify-bindings      # fails if any E_NOTIMPL in impl
xmake build header-compile-all   # each header compiles in its own TU
xmake build impl-compile-all     # each header+impl pair compiles in one TU
xmake build impl-link-all        # all impl units link together

See docs/GENERATION.md for linking (cwinrt-rt, cwinrt-bindings-all) and CI expectations.

Single namespace:

build\windows\x64\release\cwinrt-gen.exe --winmd "%ProgramFiles(x86)%\Windows Kits\10\UnionMetadata\10.0.26100.0\Windows.winmd" --ns Windows.UI.Composition -o include/cwinrt

All namespaces (~340):

cwinrt-gen.exe --batch-union --winmd ...\Windows.winmd -o include/cwinrt

Layout

  • gen/ — metadata parser and header emitter
  • rt/ — runtime (init, hstring, factory, async, event)
  • include/cwinrt/ — public headers (generated + runtime includes)
  • thirdparty/coetua/ — vendored utilities used by cwinrt-gen only (generated bindings and rt/ do not depend on coetua)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages