Use zig rc compiler when building with zig as linker#47
Use zig rc compiler when building with zig as linker#47bplaat wants to merge 2 commits intoBenjaminRi:masterfrom
zig rc compiler when building with zig as linker#47Conversation
|
Hi, thank you for your contribution. That the zig toolchain can be integrated with cargo is news to me, that sounds very cool!
Is it really when you end up in I will probably need some time to read up on this and think about it. In particular, when you compile on Linux for Windows, or on Windows (MSVC or GNU) for Windows, etc. There are various combinations and if we start supporting this, it is good to broadly know what we are working with. It would also be good to update CI to test these cases then as well, so that we don't break it once we start supporting it. But generally, I am not opposed to this at all, if it helps users of the library. What is your use-case specifically, what OS are you developing on? |
No zig always links against a self bundeld source version of MinGW libc. The
Good point, I'll update this pr with an GitHub Action job that tests the use of the zig toolchain. @BenjaminRi could you approve action runs for my user?
Mostly cross-compiling Windows binaries from macOS desktop and Linux CI runners. |
@BenjaminRi thanks for keeping the "winres" crate up-to-date in this fork.
This rough pr adds support for building Windows resources using Zig as a cross-compilation toolchain. This can easily be done with cargo-zigbuild:
Zig has included a Windows resource compiler for some time now (see: https://www.ryanliptak.com/blog/zig-is-a-windows-resource-compiler/), which is handy because it removes the need to install a full MinGW64 toolchain locally. The
zig rccommand is intended to be fully compatible withrc.exe, so I extended thecompile_with_toolkit_msvc()function to support it.The linking is still done against the GNU MinGW C runtime, which makes the current structure a bit confusing maybe. It might make sense to split this functionality into a separate function for clarity.
Looking forward to feedback :^)