This PR automates handling of MP_INCLUDE_DIR in the target_capnp_sources function, removing the need to manually propagate it across directories for both this project and downstream projects.
Switch `MP_INCLUDE_DIR` to global property #168
pull hebasto wants to merge 1 commits into bitcoin-core:master from hebasto:250331-mp-prop changing 2 files +9 −8-
hebasto commented at 2:04 PM on March 31, 2025: member
-
in CMakeLists.txt:33 in b553830720 outdated
29 | @@ -30,16 +30,14 @@ include("cmake/compat_config.cmake") 30 | include("cmake/pthread_checks.cmake") 31 | include(GNUInstallDirs) 32 | 33 | -# Set convenience variables for subdirectories. 34 | -set(MP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") 35 | +# Set a convenience global property.
ryanofsky commented at 4:36 PM on March 31, 2025:In commit "Switch
MP_INCLUDE_DIRto global property" (b55383072016479f462fb019f90896f35a642450)New comment seems to be dropping information about why a global variable or property is useful. Would suggest keeping more of original comment and changing "Set a convenience global property" to something like "Set MP_INCLUDE_DIR as a global property so target_capnp_sources function can use it, and its callers don't need to specify the include directory manually to avoid "error: Import failed: /mp/proxy.capnp" failures from capnproto. IMO, it's important for build systems to have comments like this explaining why they do things otherwise it's too easy to guess incorrectly what code was trying to do and break things when making changes.
in CMakeLists.txt:34 in b553830720 outdated
29 | @@ -30,16 +30,14 @@ include("cmake/compat_config.cmake") 30 | include("cmake/pthread_checks.cmake") 31 | include(GNUInstallDirs) 32 | 33 | -# Set convenience variables for subdirectories. 34 | -set(MP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") 35 | +# Set a convenience global property. 36 | +set_property(GLOBAL PROPERTY LIBMULTIPROCESS_MP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
ryanofsky commented at 4:39 PM on March 31, 2025:In commit "Switch
MP_INCLUDE_DIRto global property" (b55383072016479f462fb019f90896f35a642450)LIBMULTIPROCESS_MPprefix is redundant, would suggest calling the property justMP_INCLUDE_DIRorLIBMULTIPROCESS_INCLUDE_DIR, and I'd slightly prefer shorterMP_INCLUDE_DIRsince this project has used "mp" prefix for namespacing since beginning, calling its c++ namespacemp::, installing C++ and capnproto include files ininclude/mp/, and naming the code generatormpgen. But either prefix would be ok.
ryanofsky approvedryanofsky commented at 4:50 PM on March 31, 2025: collaboratorCode review ACK b55383072016479f462fb019f90896f35a642450. Nice change that simplifies https://github.com/bitcoin/bitcoin/pull/31741 and seems to make good use of cmake's global property feature. I suggested some tweaks below but they could be followups.
a77c8e18ebSwitch `MP_INCLUDE_DIR` to global property
This change automates handling of `MP_INCLUDE_DIR` in the `target_capnp_sources` function, removing the need to manually propagate it across directories for both this project and downstream projects.
hebasto force-pushed on Mar 31, 2025hebasto commented at 5:02 PM on March 31, 2025: memberThank you for your review! Your feedback has been addressed.
ryanofsky approvedryanofsky merged this on Mar 31, 2025ryanofsky closed this on Mar 31, 2025hebasto deleted the branch on Mar 31, 2025ryanofsky referenced this in commit d871f98b43 on Mar 31, 2025ryanofsky referenced this in commit d6244f85c5 on Apr 2, 2025janus referenced this in commit 85bcced4e9 on Sep 7, 2025bitcoin-core locked this on Mar 31, 2026
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: 2026-04-20 19:30 UTC
More mirrored repositories can be found on mirror.b10c.me