Add support for compiling .rc files into Windows .res files
I tried to compile an old Win32 C program with a build.zig and didn't see an obvious happy path to compile an .rc file into a .res file and add it to the build. These seem to be somewhat common in Win32 projects, so I think that if the intention is to support gradually converting Win32 C programs to Zig, being able to easily compile resource files and add them to the target should be part of that.
LLVM comes with llvm-rc, and it worked for me, but unlike windres and whatever the MSVC resource compiler is, llvm-rc doesn't run the preprocessor against the source file, so a preprocessing step with clang -E is also necessary. However, once you get a .res file out of it, it can be added to the build with addObjectFile.
For now (0.5.0+652efe38b), using addObjectFile breaks debugging in Visual Studio Code with C/C++ (ms-vscode.cpptools) extension. I am not sure why, but I'll be happy to provide any information.
LLVM has a mostly complete RC compiler that we could port to Zig and improve compatiblity https://github.com/llvm/llvm-project/tree/master/llvm/tools/llvm-rc
There are some free standalone editors (http://www.resedit.net/, http://angusj.com/resourcehacker/) so just being able to compile rc files will be good enough experience.
The typical tool for this is binutils' windres. There's a port of that to llvm's separate tools here: https://github.com/mstorsjo/llvm-mingw/blob/master/wrappers/windres-wrapper.c . It essentially pipes llvm-rc to llvm-cvtres. Having something like that available as a zig subcommand would allow zig to be used as a drop-in compiler suite for win32 C development and more.
I've started working on this here: https://github.com/squeek502/resinator