cmake: EXTERNAL_MPGEN cleanups #147

pull ryanofsky wants to merge 1 commits into bitcoin-core:master from ryanofsky:pr/cgen changing 2 files +6 −6
  1. ryanofsky commented at 6:01 pm on February 3, 2025: collaborator
  2. cmake: EXTERNAL_MPGEN cleanups
    Suggested by Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> in
    https://github.com/chaincodelabs/libmultiprocess/pull/142#pullrequestreview-2588097796
    21b92b69c9
  3. ryanofsky merged this on Feb 3, 2025
  4. ryanofsky closed this on Feb 3, 2025

  5. in CMakeLists.txt:27 in 21b92b69c9
    23@@ -24,7 +24,7 @@ if(Libmultiprocess_ENABLE_CLANG_TIDY)
    24   set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE}")
    25 endif()
    26 
    27-set(EXTERNAL_MPGEN "" CACHE STRING "Use the supplied mpgen binary rather than the one built internally")
    


    theuni commented at 6:12 pm on February 3, 2025:

    Hmm, I purposefully avoided namespacing this because I was assuming that parent projects would always want to expose the same option and have it be automatically inherited here. Now they’ll have to map it.

    Not a big deal to me either way, I guess.


    ryanofsky commented at 8:07 pm on February 5, 2025:
    For reference, code which sets this in depends is implemented in https://github.com/bitcoin/bitcoin/commit/99b7b857d3b8b9ce9bd7501e2480583369740c55 from https://github.com/bitcoin/bitcoin/pull/31741 and seems to work reasonably well

    theuni commented at 8:34 pm on February 5, 2025:

    For depends, sure, it doesn’t matter. But when doing a non-depends cross-build, ccmake shows:

    0CAPNPC_CXX_EXECUTABLE
    1CAPNP_EXECUTABLE
    2...
    3Libmultiprocess_EXTERNAL_MPGEN
    

    which is rather inconsistent and non-obvious to builders imo. Seems to me Capnp has it right. For a Core, I wouldn’t expect to see that namespace.


    ryanofsky commented at 8:55 pm on February 5, 2025:
    I see. This suggestion just came from https://github.com/chaincodelabs/libmultiprocess/pull/142#discussion_r1938116078, and I’m happy to rename this to something else or make a different change. Given the other names maybe MPGEN_EXECUTABLE would be a good name for this.

    ryanofsky commented at 8:55 pm on February 5, 2025:
    @hebasto might have more ideas too.

    theuni commented at 3:15 pm on February 6, 2025:

    I see. This suggestion just came from #142 (comment), and I’m happy to rename this to something else or make a different change. Given the other names maybe MPGEN_EXECUTABLE would be a good name for this.

    Fwiw, I originally picked EXTERNAL_CAPNP to mirror (what I thought was) the way Capnp handles it. But I see now that Capnp’s is just a bool and CAPNP_EXECUTABLE is the actual path variable. So ACK to MPGEN_EXECUTABLE instead if we go down this path.


    hebasto commented at 3:20 pm on February 6, 2025:

    So ACK to MPGEN_EXECUTABLE instead if we go down this path.

    So do I.

  6. in cmake/TargetCapnpSources.cmake:70 in 21b92b69c9
    68     if(NOT EXISTS "${MPGEN_BINARY}")
    69-      message(FATAL_ERROR "EXTERNAL_MPGEN: \"${MPGEN_BINARY}\" does not exist.")
    70+      message(FATAL_ERROR "Libmultiprocess_EXTERNAL_MPGEN: \"${MPGEN_BINARY}\" does not exist.")
    71     endif()
    72   elseif(TARGET Libmultiprocess::multiprocess)
    73-    set(MPGEN_BINARY $<TARGET_FILE:Libmultiprocess::mpgen>)
    


    theuni commented at 6:15 pm on February 3, 2025:
    I attempted this a bunch of different ways, and with some approach this was necessary, but I forget why. I assume this is fine, thanks for simplifying.
  7. theuni commented at 6:16 pm on February 3, 2025: contributor
    Thank you for the cleanups!
  8. ryanofsky referenced this in commit 8959938ed4 on Feb 3, 2025
  9. ryanofsky referenced this in commit 37fb62c3a5 on Feb 4, 2025
  10. ryanofsky referenced this in commit 1d75538a32 on Feb 5, 2025
  11. ryanofsky referenced this in commit 250c2ea54d on Feb 7, 2025
  12. ryanofsky referenced this in commit 91193005a9 on Feb 7, 2025
  13. ryanofsky referenced this in commit 9437e6846f on Feb 7, 2025
  14. ryanofsky referenced this in commit a4a8f7a7ba on Feb 7, 2025
  15. ryanofsky referenced this in commit 3a95817ece on Feb 10, 2025
  16. Sjors referenced this in commit 6aabfcb615 on Feb 10, 2025
  17. Sjors referenced this in commit 1746618e08 on Feb 13, 2025
  18. ryanofsky referenced this in commit 83e40d3b52 on Feb 24, 2025
  19. ryanofsky referenced this in commit 8619f03ec2 on Feb 24, 2025
  20. ryanofsky referenced this in commit cbb7b41c20 on Feb 24, 2025
  21. fanquake referenced this in commit 01f7715766 on Feb 25, 2025
  22. fanquake referenced this in commit ba0a4391ff on Feb 25, 2025
  23. janus referenced this in commit 86cb86b050 on Sep 1, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-04 19:30 UTC

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