1
0
Fork 0

Add documentation for @tigerw's new CMake flags (#4814)

* Add additional compilation options to CMakeLists.txt

* Add new CMake options to COMPILING file

* Add comment about CMake version requirements
This commit is contained in:
Alexander Harkness 2020-08-06 16:13:47 +00:00 committed by GitHub
parent b45d8bfc1e
commit fd52d8e8df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View File

@ -3,11 +3,14 @@
# Use CMake to generate the build files for your platform
#
# This script supports some configuration through CMake arguments (-Dparam=val syntax):
# BUILD_TOOLS=1 sets up additional executables to be built along with the server (ProtoProxy, GrownBiomeGenVisualiser, MCADefrag)
# BUILD_UNSTABLE_TOOLS=1 sets up yet more executables to be built, these can be broken and generally are obsolete (GeneratorPerformanceTest)
# NO_NATIVE_OPTIMIZATION=1 disables CPU-specific optimisations for the current machine, allows use on other CPUs of the same platform
# DISABLE_SYSTEM_LUA=1 disables the use of system Lua interpreter; the tolua executable will be built and used instead. Incompatible with cross-compiling
# SELF_TEST=1 enables testing code to be built
# BUILD_TOOLS=1 sets up additional executables to be built along with the server (ProtoProxy, GrownBiomeGenVisualiser, MCADefrag)
# BUILD_UNSTABLE_TOOLS=1 sets up yet more executables to be built, these can be broken and generally are obsolete (GeneratorPerformanceTest)
# NO_NATIVE_OPTIMIZATION=1 disables CPU-specific optimisations for the current machine, allows use on other CPUs of the same platform
# DISABLE_SYSTEM_LUA=1 disables the use of system Lua interpreter; the tolua executable will be built and used instead. Incompatible with cross-compiling
# SELF_TEST=1 enables testing code to be built
# UNITY_BUILDS=OFF disables unity builds
# PRECOMPILE_HEADERS=OFF disables precompiled headers
# WHOLE_PROGRAM_OPTIMISATION=OFF disables link time optimisation

View File

@ -256,6 +256,19 @@ Forces the build to use 32 bit builds on *nix systems. Define as ON to enable. D
###### NO_NATIVE_OPTIMIZATION
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.
###### DISABLE_SYSTEM_LUA
Disables use of the system lua, uses a compiled version instead. Useful if compiling on a system that doesn't already have lua installed. This option is incompatible with cross-compilation.
###### UNITY_BUILDS
Controls use of unity builds, an optimisation that improves compile times at the expense of system compatibility and error message utility. Some systems may need to have this disabled in order to compile properly. Unity builds are only supported on CMake versions >= 3.16, if you have an old version unity builds will always be disabled and this flag has no effect.
###### PRECOMPILE_HEADERS
Controls use of precompiled headers, an optimisation that improves compile times at the expense of system compatibility. Some systems may need to have this disabled in order to compile properly. Precompiled headers are only supported on CMake versions >= 3.16, if you have an old version precompiled headers will always be disabled and this flag has no effect.
###### WHOLE_PROGRAM_OPTIMISATION
Controls use of link time optimisation (LTO), which slightly improves the generated binary file at the expense of compilation speed and system compatibility. Some systems may need to have this disabled in order to compile properly.
[1]: https://www.visualstudio.com/downloads/
[2]: https://cmake.org/download/
[3]: https://git-for-windows.github.io/