Skip to content

Conversation

@dsnopek
Copy link
Collaborator

@dsnopek dsnopek commented Dec 7, 2025

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 godotengine/godot#113697

@dsnopek dsnopek added this to the 10.x milestone Dec 7, 2025
@dsnopek dsnopek requested a review from a team as a code owner December 7, 2025 03:35
@dsnopek dsnopek added the enhancement This is an enhancement on the current functionality label Dec 7, 2025
@dsnopek dsnopek force-pushed the gdextension-interface-via-json branch 2 times, most recently from bfedacb to 1cbfc14 Compare December 7, 2025 12:08
@dsnopek dsnopek changed the title Generate GDExtension interface header and loader from JSON [DRAFT] Generate GDExtension interface header and loader from JSON Dec 7, 2025
@dsnopek dsnopek marked this pull request as draft December 7, 2025 12:08
@dsnopek dsnopek force-pushed the gdextension-interface-via-json branch from 1cbfc14 to 74fd96a Compare December 7, 2025 12:34
@dsnopek dsnopek added cmake topic:buildsystem Related to the buildsystem or CI setup labels Dec 7, 2025
@dsnopek
Copy link
Collaborator Author

dsnopek commented Dec 7, 2025

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

@dsnopek dsnopek force-pushed the gdextension-interface-via-json branch from 74fd96a to c0006ff Compare December 8, 2025 21:03
@dsnopek
Copy link
Collaborator Author

dsnopek commented Dec 8, 2025

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

@dsnopek dsnopek force-pushed the gdextension-interface-via-json branch from c0006ff to e9fa90f Compare December 9, 2025 17:17
@dsnopek dsnopek changed the title [DRAFT] Generate GDExtension interface header and loader from JSON Generate GDExtension interface header and loader from JSON Dec 9, 2025
@dsnopek dsnopek marked this pull request as ready for review December 9, 2025 17:17
@dsnopek
Copy link
Collaborator Author

dsnopek commented Dec 9, 2025

Now that PR godotengine/godot#113697 is merged, I've updated it to match the latest in Godot master, and taken it out of DRAFT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmake enhancement This is an enhancement on the current functionality topic:buildsystem Related to the buildsystem or CI setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant