Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zig windres #9564

Closed
Akuli opened this issue Aug 14, 2021 · 7 comments · Fixed by #17412 or #22522
Closed

zig windres #9564

Akuli opened this issue Aug 14, 2021 · 7 comments · Fixed by #17412 or #22522
Labels
accepted This proposal is planned. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone

Comments

@Akuli
Copy link
Contributor

Akuli commented Aug 14, 2021

It would be really nice if zig exposed zig windres in addition to zig cc. This was previously mentioned in #7917 (comment)

For 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.

@Vexu Vexu added the proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. label Aug 22, 2021
@Vexu Vexu added this to the 0.9.0 milestone Aug 22, 2021
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 Nov 24, 2021
@jagt
Copy link
Contributor

jagt commented Mar 31, 2022

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:

  1. Integrate all files under llvm-rc into zig/src. It still need tablegen for building, so we'll choose between integrate tablegen or integrate a preprocessed code copy.
  2. Same as above but put everything under 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.

@andrewrk andrewrk added the accepted This proposal is planned. label Apr 16, 2022
@andrewrk andrewrk modified the milestones: 0.10.0, 0.11.0 Apr 16, 2022
@andrewrk andrewrk added contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. labels Apr 9, 2023
@andrewrk
Copy link
Member

andrewrk commented Apr 9, 2023

This must be implemented in Zig rather than by adding an additional dependency on LLVM/Clang.

@andrewrk andrewrk modified the milestones: 0.11.0, 0.12.0 Apr 9, 2023
@andrewrk andrewrk modified the milestones: 0.13.0, 0.12.0 Jun 29, 2023
@akavel
Copy link

akavel commented Aug 5, 2023

Is this a duplicate of #3702? Or are those two issues in any way different?

@squeek502
Copy link
Collaborator

squeek502 commented Sep 4, 2023

Is this a duplicate of #3702? Or are those two issues in any way different?

This is not a duplicate, though it does depend on #3702.

#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.

squeek502 added a commit to squeek502/zig that referenced this issue Oct 5, 2023
andrewrk pushed a commit that referenced this issue Oct 12, 2023
Uses resinator under-the-hood (see #17069)

Closes #9564
@andrewrk andrewrk modified the milestones: 0.13.0, 0.12.0 Oct 12, 2023
@squeek502
Copy link
Collaborator

Note: this was added as zig rc rather than zig windres since it's drop-in compatible with rc.exe, not windres.

@alexrp
Copy link
Member

alexrp commented Apr 18, 2024

Note: this was added as zig rc rather than zig windres since it's drop-in compatible with rc.exe, not windres.

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.

@alexrp
Copy link
Member

alexrp commented Oct 16, 2024

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.

@alexrp alexrp reopened this Oct 16, 2024
@alexrp alexrp removed this from the 0.12.0 milestone Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This proposal is planned. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Projects
None yet
7 participants