Cross-compiling with ease
The ability to compile for different operating systems or architectures than the current computer is called cross-compiling. We saw it used in the previous section to package and install a mobile app from a desktop computer. By cross-compiling, we can also build applications from one computer for other types of desktop as well, for example using Windows to build a macOS application.
There are two ways that this can be done. Firstly, we will see how developers familiar with platform-specific compilation can use their normal tools to build for multiple platforms. After that, we will look at the fyne-cross
tool and how it hides all of the complexity using a Docker image to manage compiling.
Using installed toolchains
When taking the traditional approach to cross-compiling, the computer will require an additional compiler toolchain for each platform and architecture that the developer wants to support. This is what provides the ability to compile the...