From 02775e52c43dbc82e08b6af8b87d8f320c05cb73 Mon Sep 17 00:00:00 2001 From: mathiascode <8754153+mathiascode@users.noreply.github.com> Date: Thu, 24 Aug 2017 12:19:40 +0300 Subject: Minor changes (#3909) --- COMPILING.md | 89 ++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 51 insertions(+), 38 deletions(-) (limited to 'COMPILING.md') diff --git a/COMPILING.md b/COMPILING.md index af7d56191..7ed7c7efc 100644 --- a/COMPILING.md +++ b/COMPILING.md @@ -1,12 +1,12 @@ -COMPILING -========= +Compiling Cuberite +================== To compile Cuberite from source, you need the following set of software: - * CMake - * Platform-specific make tool \(Windows would be MSVC, Linux/macOS GNU make, etc.\) - * C compiler - * modern C++ compiler and linker + - CMake + - Platform-specific make tool (Windows would be MSVC, Linux/macOS GNU make, etc.) + - C compiler + - Modern C++ compiler and linker To contribute code, you also need a Git client. @@ -15,17 +15,17 @@ Windows We use Microsoft Visual Studio for Windows compilation. It is possible to use other toolchains, but we don't test against them and they aren't supported. Visual Studio 2013 Express for Desktop is being actively used for development. -You can find download links for VS2013 Express here: https://go.microsoft.com/?linkid=9832280 +You can find download links for VS2013 Express [here][1]. -Next, you need to download and install CMake. Download from here: https://cmake.org/download/ . You should download a full installation package, so that the installer will set everything up for you (especially the paths). +Next, you need to download and install [CMake][2]. You should download a full installation package, so that the installer will set everything up for you (especially the paths). To contribute your changes to the source back to the repository, you need a Git client. Options are: - * Git for Windows: https://git-for-windows.github.io/ - * GitHub Desktop: https://desktop.github.com/ - * TortoiseGit: https://tortoisegit.org/ + - [Git for Windows][3] + - [GitHub Desktop][4] + - [TortoiseGit][5] -Alternatively, if you want only to compile the source, without contributing, you can [download the sources in a ZIP file directly from GitHub](https://github.com/cuberite/cuberite/archive/master.zip). +Alternatively, if you want only to compile the source, without contributing, you can [download the sources in a ZIP file directly from GitHub][6]. If you're using Git to get the source, use the following command to set up the local workspace correctly: @@ -39,30 +39,30 @@ Finally, open the newly created file, `Cuberite.sln`, in your Visual Studio. If you want to run Cuberite from within VS, you need to first make sure that it will be run with the correct home folder. Normally this happens automatically, but for some Visual Studio versions the process doesn't stick. Right-click on the Cuberite project in the Solution Explorer tool window, and select Properties. In the dialog, navigate to Configuration properties -> Debugging in the tree on the left, then make sure the value `Working Directory` is set to `../Server`. If you don't do this, the server won't be able to find crafting recipes, item names or plugins. -### Release configuration ### +### Release Configuration To make Visual Studio produce the version with the best performance, you will need to select a Release configuration. Go to menu Build -> Configuration Manager, and in the opened dialog, change the top left combo box (Active solution configuration) to Release. Close the dialog and build the solution. The resulting executable is called `Cuberite.exe` in the `Server` folder. -### Debug configuration ### +### Debug Configuration In order to tinker with the code, you'll more than likely need to use the debugging features of your IDE. To make them the easiest to use, you should switch to the Debug configuration - this provides the highest level of information while debugging, for the price of the executable being 2 - 10 times slower. Go to menu Build -> Configuration Manager, and in the opened dialog, change the top left combo box (Active solution configuration) to Debug. Close the dialog and build the solution. The resulting executable is called `Cuberite_debug.exe` in the `Server` folder. macOS ---- +----- -Install git from its [website](https://git-scm.com/) or homebrew: `brew install git`. + - Install git from its [website][7] or homebrew: `brew install git`. -Install Xcode (commandline tools are recommended) from the App Store or [the website](https://developer.apple.com/downloads). + - Install Xcode (commandline tools are recommended) from the App Store or [the website][8]. -Install CMake from its [website](https://cmake.org/) or homebrew: `brew install cmake`. + - Install CMake from its [website][9] or homebrew: `brew install cmake`. -### Getting the sources ### +### Getting the Source ``` git clone --recursive https://github.com/cuberite/cuberite.git ``` -### Building ### +### Building Follow the instructions at [CMake on Unix-based platforms](#cmake-on-unix-based-platforms), using Xcode as cmake's generator. If no generator is specified, CMake will use the Makefile generator, in which case you must build with the `make` command. @@ -79,13 +79,13 @@ sudo apt-get install git make cmake clang ``` Ensure that you have modern C++ compiler and linker (Clang 3.4+, GCC 4.8+, or VS 2013+). -### Getting the source ### +### Getting the Source ``` git clone --recursive https://github.com/cuberite/cuberite.git ``` -### Building ### +### Building Run the following commands to build Cuberite: @@ -103,18 +103,18 @@ Android It is required that users obtain the latest copies of: - * The Android Native Development Kit (NDK): https://developer.android.com/ndk/downloads - * Lua: https://www.lua.org/download.html (download a binary) + - [The Android Native Development Kit (NDK)][10] + - [Lua (download a binary)][11] -Windows users may optionally install the Ninja build system (https://github.com/ninja-build/ninja/releases) for improved build speeds. +Windows users may optionally install the [Ninja build system][12] for improved build speeds. -### Getting the sources ### +### Getting the Source ``` git clone --recursive https://github.com/cuberite/cuberite.git ``` -### Configuration ### +### Configuration From the `android` subdirectory: @@ -123,7 +123,7 @@ cmake . -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=16 -DCMAKE_BUILD_TYPE ``` where `CMAKE_ANDROID_NDK` should be the absolute path to where the Android NDK is installed. -#### Generators to use #### +#### Generators to Use On Linux, the default Make is suggested. No additional parameters are required for this option. @@ -136,19 +136,19 @@ where `CMAKE_MAKE_PROGRAM` should be the absolute path to the `make` program, fo The next easiest generator is Ninja, which additionally offers multithreaded builds, to be specified: * `-G "Ninja"` -#### Additional ABI options #### +#### Additional ABI Options For additional ABI options, visit: https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_ARCH_ABI.html Please note that certain ABIs require specific [API levels](#api-level-requirements). -#### API level requirements #### +#### API Level Requirements The minimum API level is 16 in the verbatim copy of this folder, due to the inclusion of position independent compilation. Additonally, API level 21 or higher is needed for 64 bit ABIs as earlier versions have no support for this architecture. To lower these requirements to run on very old devices, it is necessary to select a compatible ABI, and disable position independent code generation. -### Building ### +### Building From the `android` subdirectory: @@ -160,7 +160,7 @@ If the build succeeded, an Android-launchable binary will have been generated un To use it in the official Android app, compress the aforementioned `Server` directory into a Zip file, and transfer it to the phone on which the app is installed. -#### Using the compile script on Linux #### +#### Using the Compile Script on Linux Linux users are entitled to use the compile script, which provides some easy to use options and also contains instructions for using the binaries in the official Android app. @@ -172,7 +172,7 @@ NDK="path/to/ndk/root" CMAKE="path/to/cmake/executable" android/compile.sh