Fix API mismatch compile errors + Use Godot 4 utilities

Also clarifies the new build instructions
This commit is contained in:
Twarit Waikar
2022-12-20 18:31:31 +05:30
parent 20cb08003e
commit 91344c5e68
9 changed files with 266250 additions and 62 deletions

View File

@@ -33,30 +33,37 @@ This section onwards is only meant to be used if you intend to compile the plugi
### Release Build
```
scons platform=<platform> target=release -j 6
scons platform=<platform> target=editor gdextension_dir="../path/to/gdextension/dump/" -j 6
```
> You may get the gdextension dump yourself from Godot using the instructions in the next section, or use the ones provided in `godot-cpp/gdextension` or `ci/`.
For more build options, run `scons platform=<platform> -h`
## Dev builds
When new features are being worked on for the Godot VCS Integration, the build process sometimes requires developers to make changes in the GDExtension API along with this plugin. This means we need to manually generate the GDExtension API from the custom Godot builds and then use it to compile godot-cpp.
When new features are being worked on for the Godot VCS Integration, the build process sometimes requires developers to make changes in the GDExtension API along with this plugin. This means we need to manually generate the GDExtension API from the custom Godot builds and use it to compile godot-cpp, and then finally link the resulting godot-cpp binary into this plugin.
If you need to use a custom GDExtension API:
```
scons platform=<platform> target=debug godot_cpp=yes generate_bindings=yes bits=64 use_custom_api_file=yes custom_api_file=path/to/extension_api.json -j 6
1. Dump the new bindings from the custom Godot build.
```shell
cd local/copy/of/godot/source
.\bin\godot.xxx --headless --dump-gdextension-interface --dump-extension-api
```
You only need to build godot-cpp once every change in the GDExtension API, hence, this command should only be run the first time after generating a new JSON API file.
To reuse the once-built godot-cpp library:
2. Build the plugin along with the godot-cpp library.
```
scons platform=<platform> target=debug -j 6
scons platform=<platform> target=editor generate_bindings=yes dev_build=yes gdextension_dir="path/to/gdextension/dump" -j 6
```
To view more options available while recompiling godot-cpp, run `scons platform=<platform> godot_cpp=yes -h`.
> You only need to build godot-cpp once every change in the GDExtension API, hence, `generate_bindings=yes` should only be passed in during the first time after generating a new GDExtension API dump.
3. Open the project provided inside `demo/` in the custom Godot build.
To view more options available while recompiling godot-git-plugin, run `scons platform=<platform> -h`.
---