-
Notifications
You must be signed in to change notification settings - Fork 143
Move some heavy templates into cpp #204
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
Conversation
Sounds great! |
@Altren , I think this is a great initiative that makes a lot of sense. I think a couple of minor changes are still necessary, though: If we are going to place the JSON code into a source file, we should do the same for all supported formats. Moreover, we should then determine in the CMakeLists.txt whether we want to compile the source file for a particular format. JSON support is activated by default, but it can be turned off, so we mustn't assume that JSON can be installed. So I think there should be a source file called reflectcpp_json.cpp, reflectcpp_yaml.cpp, etc And if the flag for the format is set, the source file will be compiled. Do you understand what I mean? |
If you don't want to do this, I can do it myself. |
I agree, I wanted to suggest this change as a next step, since this require more complex changes. But I'm fine doing that in the current PR and will do that.
This would break the idea of having single source file to compile. But I guess we can keep it simple like: I'll do some initial implementation that looks good to me, then we can discuss if it have any disadvantages |
I've added json.cpp implementation. Please review and if everything looks ok for you I'll continue with other formats |
Also I feel like reflectcpp_json.cpp and reflectcpp.cpp should not be in the same directory where other source files are, but don't know how to organize this. |
@Altren , looks really great. One minor thing:
CTRE is required regardless of whether we need JSON. So this should be outside the condition
|
There are only two new commits above (XML to cpp) and squashed changes about ctre |
Should I continue with other formats in this PR or better do them in a separate on to avoid too big PR? |
…ma.hpp counterpart
^ rebased onto main to resolve conflicts |
…ssing include paths in CMake)
Just in case, now this is totally complete, unless there are more review comments |
@Altren , merged. Thank you for your contribution. |
This PR based on the #202 changes.
Cuts tests build time by 10% on my machine, no hacks or workarounds, just some simple moves to .cpp