https://github.com/cyberpuffin-digital/gdexample
Minimal Viable Project for GDExtensions in Godot 4. Derived from the Official guide (https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/) and godot-cpp-template (https://github.com/godotengine/godot-cpp-template).
https://github.com/cyberpuffin-digital/gdexample
Last synced: 3 months ago
JSON representation
Minimal Viable Project for GDExtensions in Godot 4. Derived from the Official guide (https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/) and godot-cpp-template (https://github.com/godotengine/godot-cpp-template).
- Host: GitHub
- URL: https://github.com/cyberpuffin-digital/gdexample
- Owner: cyberpuffin-digital
- License: unlicense
- Created: 2024-02-24T14:34:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-11T17:35:06.000Z (about 1 year ago)
- Last Synced: 2025-01-29T07:13:55.837Z (5 months ago)
- Language: Makefile
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# GDExample
Example GDExtension derived from the [Official guide](https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/) and [godot-cpp-template](https://github.com/godotengine/godot-cpp-template).
***This project is intended for reference only***
# Prerequisites
* Godot v4.2+
* a C++ compiler
* Build tools:
* Scons
* Make[Official list of prerequisites](https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html#setting-up-the-project)
> See also [Compiling](https://docs.godotengine.org/en/stable/contributing/development/compiling/index.html#toc-devel-compiling) as the build tools are identical to the ones you need to compile Godot from source.
## Build
The [Makefile](Makefile) defines targets for building based on the OS and debug vs release.
Run `make help` for a list of targets and descriptions.
## Build bug
__2024.02.24__:
When using the Makefile to build the gdextension with debug there will be a stack smashing error when the extension is loaded if two scons commands are run sequentially.
Remove one scons command from the debug and Godot will load the extension without issue. You can even run the removed command manually and everything should still work (based on my testing).
This bug only afflicts the debug builds, as additional memory checks are being enabled.
_Steps to reproduce_:
1. Clone the repository or run `make clean` to clear build artifacts.
2. Build the godot_cpp library (e.x., `make godot_cpp_linux`).
3. Build the GDExtension (e.x., `make gdextension_linux_debug`).
4. Load Godot_Expected results_:
Blank project loads extension and ready to create.
_Actual results_:
Stack smashing error, process terminated