Compile Godot Export Templates
The basic command to compile an export template is:
Where platform could also be windows
, android
… instead of linuxbsd
. Both templates can be compiled at the same time using template_debug/template_release
.
This generates a 70MB executable. To use this template we have to add it to desired export preset:
Optimizing the template
To reduce the executable size, we can add some more options:
Now the executable size is 64MB
Using a build profile
From the Godot editor, we can create a build profile to remove features that we don’t want the engine to have. For example, because my game is in 2d, I don’t want the 3d nodes:
When we compile the template, we have to add the build_profile parameter and specify the path to it:
Encryption
To allow the encryption of the project, so when it’s exported nobody that does not know the key can see our files, add SCRIPT_AES256_ENCRYPTION_KEY=your_key
before scons
: