MSYS2 can be used as freeciv build/development environment on Windows.

First time setup[]

- Download latest msys2 environment from

- Extract the environment from the package to a suitable location. 7-zip from can be used for extracting.

- Start the msys2 shell from mingw32.exe (to produce win32 builds) or mingw64.exe (to produce win64 builds) at environment root. If you selected mingw32.exe, ${ARCH} in following examples is mingw32. If you selected mingw64.exe, ${ARCH} is mingw64.

- Setup git directories. In the shell:

> mkdir freeciv
> cd freeciv
# Create root dirs for branch-specific directory hierarchies
> mkdir master
> mkdir S3_1
> mkdir S3_0
> # Clone freeciv repository under master/src
> cd master
> git clone src
# Create worktrees for all the other branches
> cd src
> git worktree add ../S3_1/src S3_1
> git worktree add ../S3_0/src S3_0

- Create build directories.

# Do following for each of the branches (master, S3_1, S3_0)
# This example if for S3_0
> cd ~/freeciv/S3_0/src
> ./ --no-configure-run
> cd ..
> mkdir builds
> cd builds
# Create configurations you want. This example creates
# simple gtk3.22-, Qt-, and sdl2-client configurations
> mkdir gtk3.22
> cd gtk3.22
> ../../src/configure --enable-debug --without-readline --enable-client=gtk3.22
> cd ..
> mkdir qt
> cd qt
> ../../src/configure --enable-debug --without-readline --enable-client=qt --with-qt5-includes=/${ARCH}/include --with-qt5-libs=/${ARCH}/lib
> cd ..
> mkdir sdl2
> cd sdl2
> ../../src/configure --enable-debug --without-readline --enable-client=sdl2

Building and running freeciv[]

- Go to directory of the configuration you want to build. For example S3_0 gtk3.22-client configuration

> cd ~/freeciv/S3_0/builds/gtk3.22

- Run make to build freeciv

> make

- Run produced freeciv.

> ./fcgui

Updating sources to latest ones[]

- Go to source directory of the branch you want to update. For example S2_6:

> cd ~/freeciv/S2_6/src

- Pull the changes since your last update

> git pull

You are now ready to rebuild configurations of that branch from the updated sources.

Updating msys2 environment[]

If you want to keep your msys2 environment updated against upstream changes, you can do that with

> pacman -Syu

Notice however that such updates should not be made for environments used to build official freeciv installers, as the installers should be created in well-specified environments, not necessarily up-to-date (what ever that means at a given moment) environments.

Improving msys2 environment performance[]

Msys2 environment can be very slow to use. Msys2org tweeted: "Adding the MSYS2 directory to the defender exclusion list helps a lot."