-
-
Notifications
You must be signed in to change notification settings - Fork 61
Compiling
Systems with the compile-time requirements satisfied can build the project using go build in the project root:
go buildThe make command can also be used if installed:
makeJust 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.
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
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. |
| flatpak | Use XDG Desktop Portals to communicate with the system. Useful for Flatpak or other sandboxed distribution methods on Linux. |
| gles | Force use of embedded OpenGL (GLES) instead of full OpenGL. This is normally controlled by the target device and is usually not needed. |
| migrated_fynedo | This tells the widget toolkit to use the new threading model for better performance. Only needed if not building using fyne tooling. |
| no_emoji | Removes support for displaying emojis in text fields. Makes binaries a few megabytes smaller. |
| no_metadata | Disables runtime loading of metadata. Only needed if not building using fyne tooling and then running the binary outside of the repository root. |
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. |