Follow the instructions at [CMake on Unix-based platforms](#cmake-on-unix-based-platforms).
Run the following commands to build Cuberite:
cmake -DCMAKE_BUILD_TYPE=RELEASE ..
This will build Cuberite in release mode, which is better for almost all cases. For more `cmake` options, or for building in debug mode, see the section below.
After doing so, run the command `make` in the build directory, and Cuberite will build.
CMake on Unix-based platforms
@ -143,3 +151,24 @@ When cross-compiling for another computer it is important to set cross compiling
to your cmake command.
Note that real cross-compilation is hard at this moment, because an executable generated during the build process is required for later stages, so if your computer cannot run executables it generates the build will not work.
### List of all build flags ###
Cuberite's build process supports a large number of flags for customising the builds. Use these flags by adding `-DFlag_name=Value` to the cmake configuration command. For example to enable test generation using the `SELF_TEST` flag add: `-DSELF_TEST=ON`
Adds the Cuberite tools to the build. At the moment only MCADefrag and ProtoProxy are added. Define as ON to enable. Define as OFF to disable.
Adds tools that are not working yet to the build. Currently this is only the Generator Performance Test. Used for developing these tools. Define as ON to enable. Define as OFF to disable.
Enables generation of tests and self-test startup code. Tests can be run with ctest and with makefiles make test. Define as ON to enable. Define as OFF to disable.
Forces the build to use 32 bit builds on *nix systems. Define as ON to enable. Define as OFF to disable.
Disables optimizations for the build host. This is important when building on a different machine from the one you will run Cuberite on as the build machine may support instructions the final machine does not. This flag only has any effect on linux. Define as ON to enable. Define as OFF to disable.
@ -26,9 +26,9 @@ This Linux script will download the correct binary from the project site.
- You can compile automatically for Linux with the `compile.sh` script. The script is described below.
- You can also compile manually.
- You can also compile manually. See [COMPILING.md](https://github.com/cuberite/cuberite/blob/master/COMPILING.md).
Compiling may provide better performance performance (1.5-3x as fast) and it supports more operating systems. See the [COMPILING.md](https://github.com/cuberite/cuberite/blob/master/COMPILING.md) file for more details.
Compiling may provide better performance performance (1.5-3x as fast) and it supports more operating systems.
##### The compile.sh script
This script downloads the source code and compiles it. The script is smart enough to notify you of missing dependencies and instructing you on how to install them. The script doesn't work for Windows.