Open Akuli opened 3 years ago
I took a look at zig ar
integration. It basically integrates llvm llvm-ar.cpp
as src/zig_llvm-ar.cpp
with a few changes.
When it comes to windress
which is llvm-rc
tool in llvm code base. It involves multiple files and tablegen.
The options I can think of:
llvm-rc
into zig/src
. It still need tablegen for building, so we'll choose between integrate tablegen or integrate a preprocessed code copy.zig/deps
.I'm not sure how zig_llvm-ar.cpp
is upgraded when updating to newer LLVM releases. We'll need to do the same thing to windres.
This must be implemented in Zig rather than by adding an additional dependency on LLVM/Clang.
Is this a duplicate of #3702? Or are those two issues in any way different?
Is this a duplicate of https://github.com/ziglang/zig/issues/3702? Or are those two issues in any way different?
This is not a duplicate, though it does depend on #3702.
https://github.com/ziglang/zig/pull/17069 will address #3702 but it will not close this since it doesn't add a zig cc
-like command. It shouldn't be too hard to add one once it's merged, though.
Note: this was added as zig rc
rather than zig windres
since it's drop-in compatible with rc.exe
, not windres
.
Note: this was added as
zig rc
rather thanzig windres
since it's drop-in compatible withrc.exe
, notwindres
.
Then shouldn't this be reopened? This issue's ask seems to be for a windres
-compatible interface, while #3702 seems more general.
The lack of a windres
-compatible interface means that it's still quite awkward to integrate Zig into Linux -> Windows C/C++ cross-compilation where resource files are involved. Most build systems seem to expect windres
, not rc
, in that scenario.
Per Zulip discussion (this message in particular), reopening this to track adding partial / best-effort windres
compatibility. It won't be 100%, but I believe CLI compatibility + COFF support should help with the CMake + MinGW use case.
It would be really nice if zig exposed
zig windres
in addition tozig cc
. This was previously mentioned in https://github.com/ziglang/zig/issues/7917#issuecomment-808087114For context, I have now spent a couple days trying to get a very small C program to compile on Windows, and I have ran into all kinds of weird problems. It would be awesome to just download a small self-contained thing and use it.