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

cmake: respect custom RC flags with mingw #677

Closed
wants to merge 5 commits into from
Closed

cmake: respect custom RC flags with mingw #677

wants to merge 5 commits into from

Commits on Aug 18, 2023

  1. cmake: respect custom RC flags with mingw + delete GCC_WINDRES

    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
    vszakats committed Aug 18, 2023
    Configuration menu
    Copy the full SHA
    8dcf1a9 View commit details
    Browse the repository at this point in the history
  2. restore Windows 16-bit resource flags

    In case these are considered important.
    vszakats committed Aug 18, 2023
    Configuration menu
    Copy the full SHA
    da79d56 View commit details
    Browse the repository at this point in the history
  3. restore GCC_WINDRES

    Just in case any old MinGW release may not support those Windows 16-bit
    .rc options.
    vszakats committed Aug 18, 2023
    Configuration menu
    Copy the full SHA
    1ce99e0 View commit details
    Browse the repository at this point in the history
  4. Revert "restore GCC_WINDRES"

    This reverts commit 174ce5b.
    vszakats committed Aug 18, 2023
    Configuration menu
    Copy the full SHA
    0a45f55 View commit details
    Browse the repository at this point in the history
  5. Revert "restore Windows 16-bit resource flags"

    This reverts commit a67dbb3.
    vszakats committed Aug 18, 2023
    Configuration menu
    Copy the full SHA
    454869f View commit details
    Browse the repository at this point in the history