-
-
Notifications
You must be signed in to change notification settings - Fork 97
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 an easier way to support GDExtensions for both addons and modules, specifically for includes #9212
Comments
Ya we would really be interested in this as well. Gdextension is quite slow, marshalling in and our of the godot main exe, as well as there is no in lining compiler optimization benefits nor LTO optimization benefit that can stretch across the gdextension/main-exe boundary. Plus we have so many options for our builds... ASAN, SIMD on wasm, omitting frame pointers for our gamerserver profiling, etc, etc. An absolutely ideal workflow would be to develop game logic in gdextension (with hotreload), but build our final exe's with a statically linked module (which will end up running much faster and also easier to port to a variety of other platforms... (cough cough) ) :D. |
Thanks for the proposal! So, if these extra header files (like the example, As an alternative, I think it could make sense to have godot-cpp generate header files that mirror the internal Godot files (you'd need to maintain a mapping somewhere, maybe in
Then you'd just need to make sure The actual generated As I've mentioned before, I'm not crazy about having to constantly update this mapping, and the fact that every time it changes, it'll break source compatibility for GDExtensions using it. But I think allowing this to be optional, alleviates that. Folks who don't want to build as both a GDExtension and module can continue to use the dependable include paths that won't change. |
Ok, tried to implement it here: godotengine/godot-cpp#1415 |
I found another way to do this, for anyone interested: https://github.com/Ughuuu/gdextension-to-module For the time being I will use this approach. |
Describe the project you are working on
A box2d physics server GDExtension.
Describe the problem or limitation you are having in your project
Having to support compilation for both add-on and module(Right now I don't support module builds because of big change, mainly in include headers).
Right now if you are building a module, you have some includes, and if you are building addons, you have other includes.
Eg.
Addon:
Module:
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add to godot-cpp an extra set of includes, like indirection includes, that would either use the addon path or the module path. Eg.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
These extra set of includes would do inside:
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can be used by adding these ifdefs to every addon/module project.
Is there a reason why this should be core and not an add-on in the asset library?
It could also be in another project, eg. godot-cpp-extra, and have those includes there that include then either godot-cpp or godot. But I would rather they are somewhere where they are maintained as first class citizen, eg godot-cpp.
The text was updated successfully, but these errors were encountered: