From 9bd2a2d98681add573e7e356eef361fde2ccd082 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Wed, 6 Feb 2019 00:54:49 +0100 Subject: [PATCH 1/5] Add build instructions to readme.md This includes package lists for various distributions. --- readme.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 33146ebf6..43250a9b4 100644 --- a/readme.md +++ b/readme.md @@ -21,8 +21,59 @@ text including copyright information. Please visit https://www.teeworlds.com/ for up-to-date information about the game, including new versions, custom maps and much more. -Instructions to build the game can be found at -https://teeworlds.com/?page=docs&wiki=compiling_everything. In -particular, you will need SDL2 and FreeType installed. - Originally written by Magnus Auvinen. + + +Building on Linux +================= + +Installing dependencies +----------------------- + + # Debian/Ubuntu + sudo apt install build-essential cmake git libfreetype6-dev libsdl2-dev libpnglite-dev libwavpack-dev python3 + + # Fedora + sudo dnf install @development-tools cmake gcc-c++ git freetype-devel mesa-libGLU-devel pnglite-devel python3 SDL2-devel wavpack-devel + + # Arch Linux (doesn't have pnglite in its repositories) + sudo pacman -S --needed base-devel cmake freetype2 git glu python sdl2 wavpack + + +Downloading repository +---------------------- + + git clone https://github.com/teeworlds/teeworlds --recurse-submodules + cd teeworlds + + # If you already cloned the repository before, use: + # git submodule update --init + + +Building +-------- + + mkdir -p build + cd build + cmake .. + make + +On subsequent builds, you only have to repeat the `make` step. + + +Build options +------------- + +The following options can be passed to the `cmake ..` command line (between the +`cmake` and `..`) in the "Building" step above. + +`-GNinja`: Use the Ninja build system instead of Make. This automatically +parallizes the build and is generally **faster**. (Needs `sudo apt install +ninja-build` on Debian, `sudo dnf install ninja-build` on Fedora, and `sudo +pacman -S --needed ninja` on Arch Linux.) + +`-DDEV=ON`: Enable debug mode and disable some release mechanics. This leads to +**faster** builds. + +`-DCLIENT=OFF`: Disable generation of the client target. Can be useful on +headless servers which don't have graphics libraries like SDL2 installed. From 1ac5b0414a9773c03ed8ffe9848aa78f2dcaec62 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Wed, 6 Feb 2019 23:00:20 +0100 Subject: [PATCH 2/5] Add note about how to run the program --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index 43250a9b4..c6b1ae530 100644 --- a/readme.md +++ b/readme.md @@ -60,6 +60,9 @@ Building On subsequent builds, you only have to repeat the `make` step. +You can then run the client with `./teeworlds` and the server with +`./teeworlds_srv`. + Build options ------------- From 24d571b894732a9009e1172d713bd52e0e33ce79 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Wed, 6 Feb 2019 23:01:47 +0100 Subject: [PATCH 3/5] Add compilation instructions for Windows with MSVS --- readme.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/readme.md b/readme.md index c6b1ae530..7bdafba71 100644 --- a/readme.md +++ b/readme.md @@ -80,3 +80,29 @@ pacman -S --needed ninja` on Arch Linux.) `-DCLIENT=OFF`: Disable generation of the client target. Can be useful on headless servers which don't have graphics libraries like SDL2 installed. + + +Building on Windows with Visual Studio +====================================== + +Download and install some version of [Microsoft Visual +Studio](https://www.visualstudio.com/) (as of writing, MSVS Community 2017) +with the following components: + +* Desktop development with C++ (on the main page) +* Python development (on the main page) +* Git for Windows (in Individual Components → Code tools) + +Run Visual Studio. Open the Team Explorer (View → Team Explorer, Ctrl+^, +Ctrl+M). Click Clone (in the Team Explorer, Connect → Local Git Repositories). +Enter `https://github.com/teeworlds/teeworlds` into the first input box. Wait +for the download to complete (terminals might pop up). + +Wait until the CMake configuration is done (watch the Output windows at the +bottom). + +Select `teeworlds.exe` in the Select Startup Item… combobox next to the green +arrow. Wait for the compilation to finish. + +For subsequent builds you only have to click the button with the green arrow +again. From a923b0155e1972249d56932bc96456065e49f6e6 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Wed, 20 Feb 2019 20:28:51 +0100 Subject: [PATCH 4/5] Add a link to the bam build docs --- readme.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/readme.md b/readme.md index 7bdafba71..31c65751d 100644 --- a/readme.md +++ b/readme.md @@ -106,3 +106,10 @@ arrow. Wait for the compilation to finish. For subsequent builds you only have to click the button with the green arrow again. + + +Building with bam, guides for all operating systems +=================================================== + +You can also compile Teeworlds with bam, a custom build system. Instructions +for that can be found at https://www.teeworlds.com/?page=docs&wiki=hacking. From ef651cfeb0d96832b6d89f8d1ccf2bc4f4932103 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Mon, 11 Mar 2019 18:59:06 +0100 Subject: [PATCH 5/5] Add macOS and MinGW build instructions to readme.md --- readme.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 31c65751d..11bbc4d00 100644 --- a/readme.md +++ b/readme.md @@ -24,8 +24,8 @@ the game, including new versions, custom maps and much more. Originally written by Magnus Auvinen. -Building on Linux -================= +Building on Linux or macOS +========================== Installing dependencies ----------------------- @@ -39,6 +39,9 @@ Installing dependencies # Arch Linux (doesn't have pnglite in its repositories) sudo pacman -S --needed base-devel cmake freetype2 git glu python sdl2 wavpack + # macOS + sudo brew install cmake freetype sdl2 + Downloading repository ---------------------- @@ -108,6 +111,30 @@ For subsequent builds you only have to click the button with the green arrow again. +Building on Windows with MinGW +============================== + +Download and install MinGW with at least the following components: + +- mingw-developer-toolkit-bin +- mingw32-base-bin +- mingw32-gcc-g++-bin +- msys-base-bin + +Also install [Git](https://git-scm.com/downloads) (for downloading the source +code), [Python](https://www.python.org/downloads/) and +[CMake](https://cmake.org/download/). + +Open CMake ("CMake (cmake-gui)" in the start menu). Click "Browse Source" +(first line) and select the directory with the Teeworlds source code. Next, +click "Browse Build" and create a subdirectory for the build (e.g. called +"build"). Then click "Configure". Select "MinGW Makefiles" as the generator and +click "Finish". Wait a bit (until the progress bar is full). Then click +"Generate". + +You can now build Teeworlds by executing `mingw32-make` in the build directory. + + Building with bam, guides for all operating systems ===================================================