Reputation: 173
I am just curious how the Godot engine is able to store itself in a single binary when it is capable of building using that binary. In a hurry but I'm super curious. I am working on macOS by the way.
Upvotes: 0
Views: 162
Reputation: 949
Godot uses the build system (SCons) to generate header files that contain binary data required by the engine, such as icons. Here's an example: https://github.com/godotengine/godot/blob/master/editor/icons/editor_icons_builders.py
Once the headers are generated, they are included by C++ files that use the resulting PoolByteArray variables as-is.
You can find all such files by searching for files with a _builders.py
suffix in the Godot repository.
Note that if you're working on a new project, there are libraries to do this. Godot went with a custom solution as there was probably none back when the initial work was done.
PS: Godot doesn't build itself when exporting a project. It just uses export templates which are precompiled binaries with editor functionality disabled. The export template binary is copied alongside the game data pack (PCK file). Depending on the target platform, some additional steps will be performed by the exporter, such as creating a macOS application bundle.
Upvotes: 1