From 50e0eedf09400b0a8d51a9e4342b5e436b8c54a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 20 Nov 2016 13:37:54 +0100 Subject: [PATCH] Add detailed compilation instructions --- COMPILING.md | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++ COMPILING.txt | 2 -- README.md | 5 +-- 3 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 COMPILING.md delete mode 100644 COMPILING.txt diff --git a/COMPILING.md b/COMPILING.md new file mode 100644 index 0000000..745cc17 --- /dev/null +++ b/COMPILING.md @@ -0,0 +1,96 @@ +# Compiling + +As it stands, the version of Lugaru in this repository supports Linux, OSX +and Windows. Not all toolchains are tested, thus we would welcome help from +new contributors especially regarding MSVC and OSX support. + +## Common dependencies + +You will need the following development libraries and tools, usually +available via your package manager (dnf, urpmi, apt, brew, etc.): + +- CMake +- SDL2 +- Mesa OpenGL Utility library (GLU) +- LibJPEG (TurboJPEG) +- LibPNG +- OpenAL Soft +- Ogg, Vorbis and Vorbisfile +- Zlib + +## GNU/Linux + +Both GCC and Clang are supported as compilers. Define the `CC` and `CXX` env +variables according to the compiler you want to use, if not the default one. +Then build with: + +``` +mkdir build && cd build +cmake .. +make +``` + +The resulting `lugaru` binary will expect to find the `Data/` folder next to +it, so either copy `build/lugaru` in the main directory, or create a symbolic +link to run the game. + +## Mac OSX + +The instructions should be similar to the GNU/Linux ones, but have not been +tested in a Mac environment recently. + +## Windows + +As of now, only MinGW32 and MinGW64 are supported, and were only tested by +cross-compiling from Linux. + +### MSVC + +Help needed :) + +### MinGW on Windows + +Help needed :) + +### Cross-compiling from Linux + +Cross-compiling for Windows using MinGW32 and MinGW64 was tested on Fedora +and Mageia. The instructions may vary for other distros, do not hesitate to +send a merge request to update them if need be. + +You will need to install the `mingw32-` or `mingw64-` variants of the +dependencies listed above. + +#### MinGW32 + +First you will need to setup some environment variables: +``` +export PKG_CONFIG_LIBDIR="/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/share/pkgconfig" +export PATH=/usr/i686-w64-mingw32/bin:$PATH +``` + +Then build: +``` +mkdir build-mingw32 && cd build-mingw32 +cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw32.cmake -DLUGARU_INSTALL_PREFIX=install +make +make install +``` + +The `make install` step should copy the `Data/` and required DLLs from the +system to `build-mingw32/install`. + +#### MinGW64 + +The instructions are similar to those for MinGW32: + +``` +export PKG_CONFIG_LIBDIR="/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/x86_64-w64-mingw32/sys-root/mingw/share/pkgconfig" +export PATH=/usr/x86_64-w64-mingw32/bin:$PATH +``` +``` +mkdir build-mingw64 && cd build-mingw64 +cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw64.cmake -DLUGARU_INSTALL_PREFIX=install +make +make install +``` diff --git a/COMPILING.txt b/COMPILING.txt deleted file mode 100644 index e25732e..0000000 --- a/COMPILING.txt +++ /dev/null @@ -1,2 +0,0 @@ -With GNU/Linux and macOS: -cmake . && make diff --git a/README.md b/README.md index 0952b71..67cc137 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ builds. ## Compiling -See the `COMPILING.txt` for compilation instructions on all supported +See the `COMPILING.md` for compilation instructions on all supported platforms. ## Licensing @@ -64,6 +64,3 @@ or (at your option) any later version (GPLv2+). The assets (campaigns, graphical and audio assets, etc.) are distributed under various licenses (CC-BY-SA 3.0 and Freeware) as described in the `CONTENT-LICENSE.txt` file. - -The third party dependencies of the `Dependencies` folder are distributed -under their respective licenses. -- 2.39.5