How to export a project once you have a custom version of Godot that you compiled from source?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Diet Estus

I am learning how to compile Godot from source code on Windows, using the docs found here and here.

Following the docs, I have successfully compiled the Godot executable from the command line using scons, in conjunction with both Visual Studio and WinGW, and with various optimizations (for example, tools=no, disable_3d=yes, and disable_advanced_gui=yes)

My question concerns how I can now export my actual project using one of these custom builds of Godot?

I know that I should be doing this from the command line, since the editor is disabled in the custom build, and the command would be something like:

godot --path <path_to_project\project.godot> --export <export_preset_name> game_name.exe

I already have my PATH environment variable set up to reference the custom build of Godot in the command prompt.

The problem I’m running into is that I don’t know how export presets and export templates fit into this picture, or how to set them up for my custom build.

According to the docs, export templates are “optimized versions of the engine without the editor pre-compiled for each platform”.

If that’s the case, I don’t want to use one of Godot’s default export templates, right? I need to somehow target the custom version of Godot that I compiled as the export template itself?

I think this means I need to create a new folder at %AppData%\Godot\Template beside the other template folders. I could call it, for example, 3.1.1.custom_build, and move my custom version of Godot there, renaming it windows_64_release.exe so it’s associated with the “Windows Desktop” preset.

But then the question becomes, how can you specify in the command line to use that template folder and not another one?

The only parameters mentioned in the export doc are --export and --path. It’s unclear how to link a preset to a custom export template.

So, my question boils down to this: How do you associate custom export templates to presets if you’re not using a version of Godot that has the editor enabled?

Either it’s not documented or the command line misses that feature? I never really tried this tbh

Zylann | 2019-09-04 12:47