cmake: Inherit WERROR setting for secp256k1 build #33297

pull jmoik wants to merge 1 commits into bitcoin:master from jmoik:cmake_inherit_Werror_secp256k1 changing 1 files +9 −0
  1. jmoik commented at 6:34 pm on September 3, 2025: none
    This change prevents unexpected CLI output when compiling with -DWERROR=ON (treat warnings as errors). This setting is now properly propagated to the secp256k1 subproject build. Previously, secp256k1 would be built without the -Werror flag even when the main project was configured to treat warnings as errors, creating inconsistent build behavior. https://github.com/bitcoin/bitcoin/issues/33284
  2. cmake: Inherit WERROR setting for secp256k1 build ed1c975100
  3. DrahtBot added the label Build system on Sep 3, 2025
  4. DrahtBot commented at 6:34 pm on September 3, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33297.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept NACK purpleKarrot

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  5. purpleKarrot commented at 9:25 am on September 4, 2025: contributor

    I am going to NACK every PR that adds even more -Werror. 30f642952cb5bf39479bdbe467b3950f0d09324a was a mistake and should be reverted. The correct approach to this is CMAKE_COMPILE_WARNING_AS_ERROR.

    Yes, that requires CMake 3.24 and we allow 3.22 as the minimum. It does not matter. Just accept that the setting will have no effect on Ubuntu 22.04. :man_shrugging:

    cc @hebasto

  6. hebasto commented at 11:27 am on September 4, 2025: member

    30f6429 was a mistake…

    Here is some historical context.

    When migrating the build system from Autotools to CMake, there was a unanimous expectation that, at least initially, we should aim for 100% build option compatibility. That commit introduced CMake’s counterpart to Autotools’ --enable-werror:https://github.com/bitcoin/bitcoin/blob/6e62b705328f4a52875a1dd3bfb63fbba8586a01/configure.ac#L284-L289

  7. hebasto commented at 11:34 am on September 4, 2025: member

    Yes, that requires CMake 3.24 and we allow 3.22 as the minimum. It does not matter. Just accept that the setting will have no effect on Ubuntu 22.04. 🤷‍♂️

    That seems acceptable to me, as none of the CI jobs use CMake older that 3.24. And when someone sets CMAKE_COMPILE_WARNING_AS_ERROR with an older CMake, it issues a warning:

    0CMake Warning:
    1  Manually-specified variables were not used by the project:
    2
    3    CMAKE_COMPILE_WARNING_AS_ERROR
    
  8. purpleKarrot commented at 2:05 pm on September 4, 2025: contributor

    Here is some historical context.

    Don’t take it personal. You did a great job migrating from autotools to CMake. I have zero doubts about that.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-09-10 18:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me