cmake: add ONLY_CAPNP target_capnp_sources option #230

pull ryanofsky wants to merge 1 commits into bitcoin-core:master from ryanofsky:pr/onlycap changing 1 files +11 −6
  1. ryanofsky commented at 8:25 am on October 22, 2025: collaborator

    Make target_capnp_sources function take ONLY_CAPNP option to only add cap’n proto-generated files to the target library and not add libmultiprocess-generated ones.

    This is needed in https://github.com/bitcoin/bitcoin/pull/10102 to support building with ENABLE_IPC=ON and ENABLE_WALLET=OFF because libmultiprocess-generated wallet files wallet.capnp.proxy*.c++ can’t be built without causing link errors, while the wallet.capnp.c++ file is still necessary to build because it is referenced by init.capnp and node.capnp there.

  2. cmake: add ONLY_CAPNP target_capnp_sources option
    Make `target_capnp_sources` function take `ONLY_CAPNP` option to only add cap'n
    proto-generated files to the target library and not add
    libmultiprocess-generated ones.
    
    This is needed in https://github.com/bitcoin/bitcoin/pull/10102 to support
    building with ENABLE_IPC=ON and ENABLE_WALLET=OFF because libmultiprocess-generated
    wallet files `wallet.capnp.proxy*.c++` can't be built without causing link
    errors, while the `wallet.capnp.c++` file is still necessary to build because
    it is referenced by `init.capnp` and `node.capnp` there.
    81c652687b
  3. DrahtBot commented at 8:25 am on October 22, 2025: none

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK hebasto

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

  4. in cmake/TargetCapnpSources.cmake:119 in 81c652687b
    113@@ -111,5 +114,7 @@ function(target_capnp_sources target include_prefix)
    114   # dependencies explicitly because while cmake detect dependencies of non
    115   # generated files on generated headers, it does not reliably detect
    116   # dependencies of generated headers on other generated headers.
    117-  add_custom_target("${target}_headers" DEPENDS ${generated_headers})
    118+  if(NOT TARGET "${target}_headers")
    119+    add_custom_target("${target}_headers" DEPENDS ${generated_headers})
    120+  endif()
    


    hebasto commented at 4:30 pm on November 4, 2025:

    These changes are reasonable on their own. Maybe split them into a separate commit?

    nit: I don’t think quoting is needed here.


    ryanofsky commented at 1:44 pm on November 6, 2025:

    These changes are reasonable on their own. Maybe split them into a separate commit?

    nit: I don’t think quoting is needed here.

    These are good suggestions. Just to save effort I will leave this as-is for now but would welcome a followup to make quoting more consistent. I am a little confused by quoting rules in cmake, and am not sure if for example maybe quotes would be added around generated_headers if generated filenames could contain spaces.

  5. hebasto approved
  6. hebasto commented at 4:31 pm on November 4, 2025: member
    ACK 81c652687b8dd60bc83d71a7381d16db1d746474, I have reviewed the code and it looks OK.
  7. ryanofsky merged this on Nov 6, 2025
  8. ryanofsky closed this on Nov 6, 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