cmake: Add mp_headers custom target#291
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
ryanofsky
left a comment
There was a problem hiding this comment.
Code review ACK 941f692. It seems like a good idea to expose a target that will generate the library headers so outside targets can depend on them, and since they are probably needed for most static analysis.
But I'm not sure why PR description says this is required for bitcoin/bitcoin#35468 when it doesn't seem to be referenced there. I wonder if this target is required for anything in particular.
Could also consider making this definition more consistent with target_capnp_sources:
with:
add_custom_target(mp_headers DEPENDS ${MP_PROXY_HDRS})But current definition seems ok.
I've updated bitcoin/bitcoin#35468. Please see bitcoin/bitcoin#35468 (comment). |
I've been thinking about changes in the opposite direction. The |
mp_proxy_codegen custom targetmp_headers custom target
|
The NetBSD jobs failures seem spurious: |
Yes that could make sense too. It could even make sense to keep both targets since they are intended for different purposes. The |
This target acts as a build-graph node for generated Cap'n Proto C++ headers. By providing this custom target, other targets that include the headers can properly order themselves after the generation step without needing to depend on the library target that also uses them. This convenience target is necessary for proper build dependency management, as the underlying `capnp_generate_cpp` function is not CODEGEN-aware.
The new
mp_headerstarget acts as a build-graph node for generated Cap'n Proto C++ headers. By providing this custom target, other targets that include the headers can properly order themselves after the generation step without needing to depend on the library target that also uses them.This convenience target is necessary for proper build dependency management, as the underlying
capnp_generate_cppfunction is notCODEGEN-aware.Required for bitcoin/bitcoin#35468.