Skip to content

Building

Felix Kaaman edited this page Jan 4, 2016 · 4 revisions

Iceball can be built for Windows (MinGW or MSVC), Linux and OSX. There are two ways you can build Iceball. The first is by using the Makefiles in the root directory, which support all platforms (note: not all toolchains), though they may be a bit outdated. The second and most up to date build method is by using CMake.

Prerequisites

To build Iceball you also need to get the dependencies installed on your system. Most dependencies can be downloaded from your package manager but some are a bit exotic and require you to build them yourself. These are the dependencies used by Iceball:

  • SDL 2 – Window management, input, sound, etc.
  • Lua 5.1 – Game scripting
  • zlib 1.2 – Compression
  • ENet 1.3 – Networking
  • sackit – Playing .it files

Out of these, only sackit should require manual building. Here are a few examples of installing the common libraries using various package managers. You should be able to figure out the correct setup for your own platform:

# Ubuntu et. al
$ apt-get install lua5.1 libenet-dev libsdl2-dev

# OS X
$ brew install lua, enet, SDL

Sackit

Building sackit can be done using both Makefiles and CMake as well, though it is recommended that you use cmake for installation. Short and simple, just do

$ cd sackit

# create out-of-tree build at build/
$ cmake . -Bbuild

# compile and install
$ cmake --build build/ --target INSTALL

Sourceball

Windows is a bit of an oddball in that it's extremely frustrating to do all of the above. Getting the correct versions, compiling with the right flags and then putting it in the right place can make you want to rip out your hair. For that reason there is a repository called sourceball set up for building all of the dependencies in one go (including sackit).

Full instructions on building the dependencies through sourceball is available on its project page.

After you have built everything, you can simply copy the dist/ folder that was created into the root directory of iceball. Now you're ready to continue to the CMake section!

NOTE: This is only for working with CMake + Windows (which you should be doing anyway :shipit:)

NOTE: You are free to get the dependencies your own way, but you have been warned.

CMake

This will be the most up to date method of building Iceball. Assuming you've set up the dependencies correctly, building should be as simple as this:

# create out-of-tree build
$ mkdir build && cd build

# configure (note that only MinGW and MSVC are supported on windows)
$ cmake .. -G <generator>

# compile & link
$ cmake --build .

Makefiles

This is the "old" way of building, and can be a bit cumbersome to use. It is expected that all dependencies are in your path when you use these and it's not uncommon to have a outdated Makefile due to them being manually maintained. To build with Makefiles, simply execute the following in your shell:

$ make
# The default Makefile is for linux

$ make -f Makefile.mingw
# MinGW is the only supported toolchain for windows here

$ make -f Makefile.osx
# OSX has its own as well to handle a few discrepancies
Clone this wiki locally