Skip to content

Compiling

Jacob Alzén edited this page Sep 10, 2023 · 4 revisions

Systems with the compile-time requirements satisfied can build the project using go build in the project root:

go build

The make command can also be used if installed:

make

Just typing make is the same as running make build. Release binaries can be built by running make release (trims debug info).

These two ways of compiling do not include any special metadata required for some platforms. Windows and macOS developers might want to look at the With metadata section further below.

With metadata

To build binaries that include application metadata (not required on Linux or BSD), you first need to install the fyne command:

go install fyne.io/fyne/v2/cmd/fyne@latest

The fyne command can then be used to build. This will include the metadata exposed in the FyneApp.toml file and also pass the -H=windowsgui ldflag for Windows builds to make sure that a terminal does not get opened when starting the application.

fyne build

To build a release binary (with update checking enabled and smaller binary size) you pass the -release flag:

fyne build -release

Build tags

It is possible to pass build tags to the Go compiler to allow it to compile different sets of files. These flags can be set by passing -tags followed by the tag or tags. Below is a table of the tags that are supported by Rymdport:

Tag Description
release Enables release mode compilation. This enables automatic update checking on startup.
gles Force use of embedded OpenGL (GLES) instead of full OpenGL. This is normally controlled by the target device and is usually not needed.
no_emoji Removes support for displaying emojis in text fields. Makes binaries a few megabytes smaller.

Ldflags

These are the most notable ldflags. More are supported by Go but information about that can be found elsewhere.

Tag Description
-H=windowsgui Tells the Windows to not open a terminal on startup.
-s -w Removes debug symbols from the binary for smaller size.
Clone this wiki locally