summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-04-21 19:43:00 +0200
committerPatric Stout <github@truebrain.nl>2021-04-21 22:48:11 +0200
commit96b78bc2cd9790e89228c53b4803a78320fc20bd (patch)
treeab3feceb066a1bc3232ffaae6ec9593174ea8f86
parent69355293aa2012f3dc778e88c76b71f0e65476cb (diff)
downloadopenttd-96b78bc2cd9790e89228c53b4803a78320fc20bd.tar.xz
Doc: indicate the most common options for CMake
-rw-r--r--COMPILING.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/COMPILING.md b/COMPILING.md
index 4e573f012..06f54262e 100644
--- a/COMPILING.md
+++ b/COMPILING.md
@@ -78,6 +78,8 @@ files himself via the `ZERO_CHECK` project.
## All other platforms
Minimum required version of CMake is 3.9.
+By default this produces a Debug build with assertations enabled.
+This is a far slower build than release builds.
```bash
mkdir build
@@ -89,6 +91,25 @@ make
For more information on how to use CMake (including how to make Release builds),
we urge you to read [their excellent manual](https://cmake.org/cmake/help/latest/guide/user-interaction/index.html).
+## CMake Options
+
+Via CMake, several options can be influenced to get different types of
+builds.
+
+- `-DCMAKE_BUILD_TYPE=RelWithDebInfo`: build a release build. This is
+ significant faster than a debug build, but has far less useful information
+ in case of a crash.
+- `-DOPTION_DEDICATED=ON`: build OpenTTD without a GUI. Useful if you are
+ running a headless server, as it requires less libraries to operate.
+- `-DOPTION_USE_ASSERTS=OFF`: disable asserts. Use with care, as assert
+ statements capture early signs of trouble. Release builds have them
+ disabled by default.
+- `-DOPTION_USE_THREADS=OFF`: disable the use of threads. This will block
+ the interface in many places, and in general gives a worse experience of
+ the game. Use with care.
+- `-DOPTION_TOOLS_ONLY=ON`: only build tools like `strgen`. Does not build
+ the game itself. Useful for cross-compiling.
+
## Supported compilers
Every compiler that is supported by CMake and supports C++17, should be