GDExtensions, CMake, VSCode
Some things I wish I knew the first time around.
So who is this post for? Myself for one: God knows I forget half this stuff every time I fire up a new project. Really, though, I’ve written it at anyone familiar with Godot who wants to get better with C++, and anyone familiar with C++ who wants to get better with Godot.
Prerequisites
First, I want to give an entry-level explainer on
I also want to make a quick note about compilers here. If you’re following this tutorial on Windows you’ll be using MSVC by default; I personally prefer clang for its suite of compiler optimisations (nice foreshadowing for a future blog, that). Just please, Christ, whatever you do, don’t use gcc.
File Structure
godot-cpp
Go into extensions. Run git submodule add -b 4.x https://github.com/godotengine/godot-cpp, then init.
This is, mercifully, the first and only time we’ll need scons as we generate these
CMake
root: does what?
extensions: linking
gdextension: add nuance, etc.