Skip to content

driver1998/winrt-component-mingw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MinGW WinRT Component Demo

This is a demo of in-proc WinRT component on MinGW.

Why

To stress test the new C++/WinRT MinGW support mostly, also it is fun.

Build

To build this, you'll need the following:

  • CMake
  • C++/WinRT cppwinrt.exe in $PATH
  • A MinGW toolchain, LLVM/Clang 17 and GCC 13 from MSYS2 are tested.

The best way to get a working toolchain is install the following in MSYS2:

# CLANG64 Subsystem, with LLVM/Clang
pacman -S mingw-w64-clang-x86_64-{toolchain,cppwinrt,cmake,ninja}

# UCRT64 Subsystem, with GCC
pacman -S mingw-w64-ucrt-x86_64-{toolchain,cppwinrt,cmake,ninja}

With these, just build using CMake:

cd component
mkdir build && cd build
cmake ..
cmake --build .

Test

C++ and C# test programs are provided, and can be built and run normally.

Notes about metadata

Since the official MIDL 3.0 compiler midl.exe is proprietary, CsWinMD from C#/WinRT is used as an alternative, which uses C# code to define components instead of IDL.

You can take a look at component.cs for an example.

Some other alternatives:

  • Wait for Wine's widl to support winmd output
  • riddle from windows-rs, which uses Rust-like rdl syntax
  • Just use midl.exe if you are OK with this

About

In-proc WinRT component on MinGW

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published