Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Generate multiple headers #358

Open
SirusDoma opened this issue Dec 28, 2024 · 0 comments
Open

[C++] Generate multiple headers #358

SirusDoma opened this issue Dec 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@SirusDoma
Copy link
Contributor

SirusDoma commented Dec 28, 2024

Is your feature request related to a problem? Please describe.
Currently bebop only produce one single massive header file (along with auxiliary header) when compiling bop files to C++ header file.

This limitation prevents any serious C++ project from using bebop because complex project will likely have many records in different layers. Any changes are made to a record will lead unnecessary triggering recompilation of unrelated codebase of changes for every layer that depends on the generated header despite the user make no changes to the relevant models.

For example; a game may use bebop for serializing their assets and network messages. Any changes made to one of these parts will trigger full-recompilation of assets and network modules since both of these module refer to a single header file.

Describe the solution you'd like
Find a way to generate multiple header files. For example, protobuf generate 2 header files for each proto file; one is the header and the other is forward declaration. Which is very helpful reducing the compile time.

Describe alternatives you've considered
One solution is to separate the CMake generator into multiple targets. However, this won't play nicely if the project has shared/common bop files. These shared/common bop files will be generated on each targets which lead to multiple definition -> compile error. You will likely to have separate definition in each module which is painfully redundant to implement on the user side.

Additional context
For reference, Protobuf and capnproto make a header for each definition instead of compiling it into one single header file

@SirusDoma SirusDoma added the enhancement New feature or request label Dec 28, 2024
@SirusDoma SirusDoma changed the title Generate multiple headers for C++ [C++] Generate multiple headers Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant