wasphin opened a new pull request, #3596:
URL: https://github.com/apache/brpc/pull/3596
### What problem does this PR solve?
Issue Number: N/A
Problem Summary:
CMake currently packages the production modules into the brpc bundle.
Applications
that only need butil, bvar, bthread, json2pb or mcpack2pb cannot consume an
installed
component target independently, which also prevents packaging these modules
for
standalone use through vcpkg.
### What is changed and the side effects?
Changed:
The four commits separate directory ownership, target ownership, component
packaging and mcpack IDL ownership so each stage can be reviewed
independently:
1. Move production source definitions into their module directories.
2. Define module-owned object targets, scope feature/dependency handling to
the
owning modules and reuse those targets for the legacy bundles and tests.
3. Add optional component libraries and exported CMake package targets.
4. Make mcpack2pb own the IDL option schema, generated public header and
symbols,
updating CMake, Make and Bazel rules without changing public import names.
- `BRPC_BUILD_COMPONENT_LIBS` is OFF by default. Enabling it builds all six
components alongside the existing bundle; `BUILD_SHARED_LIBS` controls the
standalone libraries' linkage.
- Export `brpc::butil`, `brpc::bvar`, `brpc::bthread`, `brpc::json2pb`,
`brpc::mcpack2pb` and `brpc::brpc` with their transitive dependencies.
The RPC-only library is named `libbrpc-only` to avoid conflicting with the
existing `libbrpc` bundle.
- Install headers directly from module source/build directories and use
target
build/install interfaces instead of staging copies in `output/include`.
- Keep generated IDL definitions in mcpack2pb and obtain them transitively
from
the RPC component. Preserve `import "idl_options.proto"` and
`#include "idl_options.pb.h"`.
- Do not distribute producer-side custom Find modules in the installed
package.
- Add six standalone consumer checks, including custom-option consumption
and a
complete RPC client/server exchange using an ephemeral server port.
- Update both English and Chinese getting-started documentation, including an
independent vcpkg consumer example. The documented `components` feature is
provided by an overlay port, not the current registry port.
Side effects:
- Performance effects: Production objects are compiled once and reused by the
bundle and standalone libraries. Enabling components adds library linking
and
packaging work; it does not duplicate production source compilation.
- Breaking backward compatibility: Existing bundle names and linkage remain
unchanged, and standalone components are opt-in. CMake builds no longer
stage
headers in `output/include`; users relying on that directory should run
`cmake --install build --prefix build/output`. Do not link the bundle and
standalone components into the same application because they share symbols.
---
### Check List:
- [x] Please make sure your changes are compilable.
- [x] When providing us with a new feature, it is best to add related tests.
- [x] Please follow [Contributor Covenant Code of
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]