cmake: Rename `SECP256K1_LATE_CFLAGS` and switch to Bitcoin Core's approach #1546

pull hebasto wants to merge 2 commits into bitcoin-core:master from hebasto:240620-append-cflags changing 2 files +8 −18
  1. hebasto commented at 1:58 PM on June 21, 2024: member

    This PR address this https://github.com/hebasto/bitcoin/issues/239#issuecomment-2182713690:

    For consistency with libsecp256k1:

    Is this code block supposed to achieve the same as our SECP256K1_LATE_CFLAGS (implemented by a user-defined function all_targets_add_compile_options) in libsecp256k1?

    It is. But this approach guaranties to override even options that are abstracted by CMake, for instance #157 (comment).

    • If we agree that appending to rule variables is superior, should we also do this in libsecp256k1?

    • And/or should we rename the SECP256K1_LATE_CFLAGS variable to APPEND_CFLAGS?

  2. cmake: Rename `SECP256K1_LATE_CFLAGS` to `SECP256K1_APPEND_CFLAGS`
    This change follows the naming convention currently used in the Bitcoin
    Core's CMake staging branch.
    c2764dbb99
  3. hebasto commented at 1:59 PM on June 21, 2024: member

    @real-or-random

    Your other comments from the discussion in https://github.com/hebasto/bitcoin/issues/239 have also been included.

  4. in CMakeLists.txt:287 in 91febae005 outdated
     283 | @@ -284,14 +284,16 @@ if(SECP256K1_BUILD_BENCHMARK OR SECP256K1_BUILD_TESTS OR SECP256K1_BUILD_EXHAUST
     284 |    enable_testing()
     285 |  endif()
     286 |  
     287 | -set(SECP256K1_LATE_CFLAGS "" CACHE STRING "Compiler flags that are added to the command line after all other flags added by the build system.")
     288 | -include(AllTargetsCompileOptions)
     289 | +set(SECP256K1_APPEND_CFLAGS "" CACHE STRING "Compiler flags that are appended to the command line after all other flags added by the build system. It is intended for debugging and special builds.")
    


    real-or-random commented at 3:09 PM on June 21, 2024:

    nit:

    set(SECP256K1_APPEND_CFLAGS "" CACHE STRING "Compiler flags that are appended to the command line after all other flags added by the build system. This variable is a global override intended for debugging and special builds.")
    

    happy to drop the "global override", but "It is" was a bit imprecise, it's not clear what the "It" refers to.


    hebasto commented at 3:15 PM on June 21, 2024:

    Reworked. Not using "global override" as it can be confusing in cases when libsecp is integrated by an upstream project.

  5. real-or-random commented at 3:09 PM on June 21, 2024: contributor

    ACK mod nit

  6. real-or-random added the label build on Jun 21, 2024
  7. cmake: Reimplement `SECP256K1_APPEND_CFLAGS` using Bitcoin Core approach 4706be2cd0
  8. hebasto force-pushed on Jun 21, 2024
  9. real-or-random approved
  10. real-or-random commented at 4:09 PM on June 21, 2024: contributor

    utACK 4706be2cd0bcac97da10ed3b98790f1ac6f04efb

  11. hebasto commented at 4:14 PM on June 21, 2024: member

    Friendly ping @theuni :)

  12. fanquake commented at 9:18 AM on June 25, 2024: member

    Concept ACK. Aligning the naming is nice and this implementation is simpler. I think "special builds" is ambiguous, and downstreams may likely (mis)use this option in any case, but I can't really think of anything better to call it.

  13. real-or-random merged this on Jun 25, 2024
  14. real-or-random closed this on Jun 25, 2024

  15. hebasto deleted the branch on Jun 25, 2024
  16. fanquake referenced this in commit b941c15808 on Jun 25, 2024
  17. hebasto referenced this in commit b20389c74a on Jun 25, 2024
  18. fanquake referenced this in commit 1408944d2e on Jun 25, 2024
  19. achow101 referenced this in commit 9ac4f69ec2 on Jun 26, 2024
  20. hebasto referenced this in commit 119b07e97e on Jun 27, 2024
  21. vmta referenced this in commit bafdd96c0a on Jul 3, 2024
  22. janus referenced this in commit 411aef6677 on Jul 26, 2024
  23. hebasto referenced this in commit 3cc2b0df80 on Sep 2, 2024
  24. hebasto referenced this in commit 1e0dcc5b18 on Sep 2, 2024
  25. vmta referenced this in commit 871c80c433 on Sep 6, 2024
  26. hebasto referenced this in commit bc8283b7ac on Sep 7, 2024
  27. hebasto referenced this in commit 2d68c3b1c2 on Sep 9, 2024
  28. fanquake referenced this in commit e4fb97a512 on Sep 10, 2024
  29. vmta referenced this in commit 4d1f6d5635 on Oct 29, 2024
  30. janus referenced this in commit 0a420686a7 on Jan 12, 2025
  31. div72 referenced this in commit af627d47c3 on Apr 12, 2025
  32. oskarszoon referenced this in commit 0d5c9260f4 on Jul 1, 2025
  33. real-or-random referenced this in commit 4ae7cb4f71 on Feb 11, 2026
  34. github-actions[bot] referenced this in commit 758d4e90b4 on Mar 1, 2026
  35. github-actions[bot] referenced this in commit 68a2178f22 on Mar 1, 2026
  36. github-actions[bot] referenced this in commit a8bc1a0b2b on Mar 1, 2026
  37. 0x000000000019d6689c085ae165831e934ff76 referenced this in commit 3b9450150d on Mar 2, 2026
  38. csjones referenced this in commit a4d92824ae on Mar 2, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:52 UTC