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

First time setup Edit

- 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
> git clone git
# Create root dirs for branch-specific directory hierarchies
> mkdir master
> mkdir S3_0
> mkdir S2_6
> cd git
# Only one worktree can have checkout of a given branch. Checkout
# unused branch here so we can later checkout other branches to
# their real hierarchies
> git checkout S2_4
# Create worktrees for all the branches
> git worktree add ../master/src master
> git worktree add ../S3_0/src S3_0
> git worktree add ../S2_6/src S2_6

- Create build directories.

# Do following for each of the branches (master, S3_0, S2_6)
# This example if for S2_6
> cd ~/freeciv/S2_6/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 Edit

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

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

- Run make to build freeciv

> make

- Run produced freeciv.

> ./fcgui

Updating sources to latest ones Edit

- 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 Edit

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.

Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+