1
0
mirror of synced 2025-02-02 12:27:20 +01:00

Updated docs

This commit is contained in:
Stepland 2020-02-11 20:33:02 +01:00
parent 53991a2389
commit 2942ab4dc0

View File

@ -3,24 +3,45 @@
jujube uses the meson build system.
Only time will tell if this turned out to be a wise choice, I wanted to try something other than CMake.
jujube needs a *very* up to date C++ compiler for I'm using stuff like `std::filesystem` which is, at the time of writing, *easily* availble only on the last few versions of your favorite compiler
Regardless of the target platform the build steps are pretty much the same :
0. Get an up-to-date C++ compiler (compatible with C++17 at least, with support for `std::filesystem`)
0. Install (or build) the dependencies :
- **meson** : the build system, installation explained [here](https://mesonbuild.com/Quick-guide.html)
- **SFML 2.5.1** : the game framework
0. Download the code from the repo
0. Go to your terminal and type
```bash
$ cd {jujube repo root}
$ CXX={your compiler} meson build
$ cd build
$ ninja
```
(Replacing the `{...}`s with what you chose)
and voila !
## Linux
### Dependancies
For the compiler, `gcc 8.0.0` and up should work but I only tested with `gcc 9.2.1`
- **SFML 2.5.1** : You will most likely need to build SFML yourself, and with the same compiler as the one you will use for jujube because if you just get precompiled binaries for SFML from your package manager you *will* have compatibility problems. [Here's](https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php) their docs.
- **meson** : Installation explained [here](https://mesonbuild.com/Quick-guide.html)
The meson install is pretty straightforward.
### Building
For SFML, If you want to use another compiler than the one shipped with your system you may need to re-build SFML yourself using the compiler you chose. [Here's](https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php) their docs. Don't forget to manually specify the compiler at the configuration step.
let's say you downloaded the source code in a folder called `jujube` and you decided to compile with `gcc-9`
## Windows
This section explains how to setup MSYS2 to compile jujube. MSYS2 is most likely *not* the only way to go but it's my favorite way of getting a very recent c++-friendly toolchain on windows.
If you managed to compile jujube with another toolchain you're very welcome to do a PR appending this part of the documentation.
### MSYS2
Installing MSYS2 is extremly straightforward and detailed [on their website](https://www.msys2.org/).
Once you're done `pacman -Syu`ing and `pacman -Su`ing your system you can install the required packages for jujube :
```bash
$ cd jujube
$ CXX=gcc-9 meson build
$ cd build
$ ninja
$ pacman -S mingw-w64-x86_64-sfml
```
And that's it !
then you can just use the same build commands as Linux