-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
Add support for build profiles. #1167
Conversation
585f32b
to
a0acdea
Compare
For reference, with the following build profile:
Those are the resulting size for the webrtc plugin:
Note that I had to manually delete:
And I had to edit godot.cpp to prevent it from including This also hugely decreases the compilation time:
|
Thanks, Fabio! This is looking awesome so far :-) It'd be great if ancestors of the enabled classes were automatically included, so you can just specify the Also, it'd be super awesome to have a script that could scan a GDExtension's source code for |
Ah, we probably need a special case to set a |
d74cf74
to
081c693
Compare
I've added support for automatically including parents (and excluding children in the case of disabled classes). It still needs a few extra manual includes, or some methods will reference undefined symbols. I think one option is to scan methods and either include the referenced classes, or exclude the offending methods. |
e7126c7
to
2bb9bdb
Compare
I've pushed some fixes and improvements:
|
2bb9bdb
to
ceb8e43
Compare
@Faless What else do you want to add before taking this PR out of draft? I just tested it again after rebasing on It would be nice to have a tool to help developers create build profiles, but I think it'd be fine to merge this since it's still pretty useful as-is. We can make it easier to use in follow-ups. |
80fe39c
to
b79f1f0
Compare
I missed this ping completely, but I wanted to explore the possibility of adding method-scanning to include (and exclude) non-inheritance dependencies. I've done that that in my last update, this makes creating "enabled_classes" dependencies much easier (at the cost of possibly building slightly more files). I'll mark this as ready. |
Allow enabling or disabling specific classes (which will not be built).
b79f1f0
to
1186c48
Compare
I've also backported this patch to godot-cpp 4.1, 4.0, 3.x (gdnative) to speed up webrtc-native plugin builds. In case anyone is interested, see: godotengine/webrtc-native#147 |
Thanks, this is looking really great to me! I've been experimenting with it for the 'godot_openxr_vendors' extension, see: GodotVR/godot_openxr_vendors#149 Something that occurs to me for the future: if we could also eliminate methods that an extension isn't calling, that would allow reducing the classes that get built even further. On 'godot_openxr_vendors' we have some editor plugins, and that leads to tons of classes getting built that we don't use at all, just because |
Yeah, sadly that's a bit more complex as far as I can tell. Class headers seem to have something (methods or types bindings?) which references the constructor of object types in arguments / return values (thus causing undefined references even if you don't use the given method at all). We should investigate what specifically causes the reference, and change the binding generators so the offending code is either moved to the |
It's the Anyway, that's for another issue/PR to look at :-) |
Cherry-picked for 4.2 in PR #1527 |
Cherry-picked for 4.1 in PR #1529 |
Allow enabling or disabling specific classes (which will not be built).
This is similar to upstream godot
build_profile
s.Try building the test with:
Partly address #1160.