-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cmake: respect custom RC flags with mingw #677
Conversation
RC
flags with mingw + cleanups
RC
flags with mingw + cleanupsNo luck with our bugfix patch sadly: madler/zlib#677
@madler Any love for this PR? |
@nmoinvaz Can you enable CI workflows for this PR please? |
Hey @vszakats, sorry I don't have access. I'm just a pleb like everybody else here. 😂 |
Oh, okay, no worries, I do understand the feeling! :) [ as a shot in the abyss why this PR is not going anywhere, I was about to reinstate the Windows 16-bit bits, if maybe this is a reason for the silence. For the sake of all those Windows 3.11 users out there. One can only guess. ] |
Updated the patch to keep support for these legacy bits:
Please let me know if there is any other concern. |
Added a build error log to the top post. |
Any interest in merging this? Or concerns to address that would allow merging? |
This one omits building a shared zlib, and thus doesn't need windres. Ref: madler/zlib#677
If using 1K more of RAM on Windows 16-bit is fine with |
Deleted the Windows 16-bit legacy resource flags once again. |
Before this patch, `zlib.rc` was compiled using a manual command [1] when using the MinGW toolchain. This method ignores `CMAKE_RC_FLAGS` and offers no other way to pass a custom flag, breaking the build in cases where a custom windres option is required. E.g. `--target=` or `-I` on some platforms and configuration, in particular with llvm-windres. This patch deletes the special case for MinGW and lets CMake compile the `.rc` file via the standard way used for all `WIN32`. Also: - Adjust the condition for dealing with the `.rc` file from `NOT MINGW` to `WIN32`, thus omitting this unnecessary input file for non-Windows platforms. - Delete the MinGW-specific RC flag `GCC_WINDRES`. `GCC_WINDRES` was protecting logic that compiles fine with recent `windres` versions. Also, the protected line contained obsolete, 16-bit era keywords that had no effect for a long time. [2] - Delete the MinGW-specific defaulting logic for `CMAKE_RC_COMPILER`. This is done by CMake automatically, to the more portable default value `windres` (there is no `.exe` extension in cross-toolchains). [1] dc5a43e [2] https://docs.microsoft.com/windows/win32/menurc/common-resource-attributes
In case these are considered important.
Just in case any old MinGW release may not support those Windows 16-bit .rc options.
This reverts commit 174ce5b.
This reverts commit a67dbb3.
Use a less convoluted, shorter workaround instead. It appears that zlib is either uninterested in accepting bugfixes, or thinks that the correct fix might be wrong, or may break compatibility with 20+ year old CMake releases, or possibly breaking some old, undefined system, or may hit a niche bug somebody heard about, and/or just afraid to make any changes, or even let its CI run on them. PR (abandoned): madler/zlib#677
@vszakats: Why have you closed this PR? |
Seeing this pending for a year+ (through 2 releases, and without zero feedback, not even allowing tests to run) and seeing other fixes (for even worse bugs) with 5+ years of wait, it appears that zlib is uninterested to touch CMake or even give any feedback to know what it wants. I think this patch is solid and the workarounds for this bug are painful, so if someone is willing to deal with the "process" at zlib, or zlib wants to cherry pick it manually, it would improve things for everyone. Feel free to do it. |
Before this patch,
zlib.rc
was compiled using a manual command [1] whenusing the MinGW toolchain. This method ignores
CMAKE_RC_FLAGS
andoffers no other way to pass a custom flag, breaking the build in cases
where a custom windres option is required. E.g.
--target=
or-I
onsome platforms and configuration, in particular with llvm-windres.
This patch deletes the special case for MinGW and lets CMake compile the
.rc
file via the standard way used for allWIN32
.Also:
Adjust the condition for dealing with the
.rc
file fromNOT MINGW
to
WIN32
, thus omitting this unnecessary input file for non-Windowsplatforms.
Delete the MinGW-specific RC flag
GCC_WINDRES
.GCC_WINDRES
was protecting logic that compiles fine with recentwindres
versions. Also, the protected line contained obsolete,16-bit era keywords that had no effect for a long time. [2]
Delete the MinGW-specific defaulting logic for
CMAKE_RC_COMPILER
.This is done by CMake automatically, to the more portable default
value
windres
(there is no.exe
extension in cross-toolchains).[1] dc5a43e
[2] https://docs.microsoft.com/windows/win32/menurc/common-resource-attributes
This fixes build errors like this one: