godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

[DRAFT] Generate GDExtension interface header and loader from JSON

Open dsnopek opened this issue 2 weeks ago • 2 comments

This is the first step towards "godot-cpp v10" as described in this proposal.

It does a bunch of things:

  • Generates the gdextension_interface.h from gdextension_interface.json
  • Replaces most of the code that loads the GDExtension interface functions with code also generated from gdextension_interface.json
  • Adds a deprecated=no option for SCons to prevent loading deprecated GDExtension interface functions
  • Puts the loaded functions under godot::gdextension_interface rather than godot::internal, making them officially part of the API
  • Allows working with both Godot 4.5 or 4.6, depending on which version generated the extension_api.json
  • Standardizes on using fully qualified namespaces for ::godot::gdextension_interface and ::godot::internal

~~There's one important thing this it does NOT do, which is cmake support for the build system changes. That's something I've still got to figure out.~~

Marking as DRAFT because it now depends on Godot PR https://github.com/godotengine/godot/pull/113697

dsnopek avatar Dec 07 '25 03:12 dsnopek

Hrm. MSVC is having issues with using interface as a namespace, but only when building with CMake? That's odd...

dsnopek avatar Dec 07 '25 12:12 dsnopek

I ended up renaming interface to gdextension_interface, which I think I like better anyway :-)

dsnopek avatar Dec 08 '25 21:12 dsnopek

Now that PR https://github.com/godotengine/godot/pull/113697 is merged, I've updated it to match the latest in Godot master, and taken it out of DRAFT

dsnopek avatar Dec 09 '25 17:12 dsnopek