capnproto: add lite_mode option #26282
Open
+17
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Changes to recipe: capnproto/all
Motivation
Cap'n Proto's build scripts provide a "lite mode" build option, where only libkj and a subset of libcapnp (no reflection) is built. This PR exposes it via a Conan option, so that lite mode can be used by Conan packages that do not depend on full functionality and need to be small or more portable (e.g. for old Androids).
Details
The changes to enable lite mode are minimal: This merely modified the value of --enable-reflection/CAPNP_LITE, and updates the components list depending on the option value.
Users can use Cap'n Proto like so to compile schema files in their CMakeLists, while using a stripped-down version of Cap'n Proto in their application (cross-)build.
Tested on macOS 15.2 and cross-compiled to Android with NDK r27 and iOS 18.