Make "Building the game" section compacter

This commit makes the readme appear compacter by hiding details in spoilers that can be revealed by clicking on the summary title. This should improve the readability of the document.
This commit is contained in:
Hielke Morsink 2023-01-12 13:32:36 +01:00 committed by GitHub
parent d8cb15bd50
commit 67a39504e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 69 additions and 46 deletions

115
readme.md
View File

@ -95,10 +95,47 @@ Some \*BSD operating systems offer native packages. These packages are usually t
OpenRCT2 requires original files of RollerCoaster Tycoon 2 to play. It can be bought at either [Steam](https://store.steampowered.com/app/285330/) or [GOG.com](https://www.gog.com/game/rollercoaster_tycoon_2).
### Windows:
- Visual Studio 2022 (Enterprise / Professional / [Community (Free)](https://www.visualstudio.com/vs/community/))
- Desktop development with C++
- MSYS2 MinGW Toolchain. The toolchains with supported dependencies are `mingw-x86_64`, `mingw-xi686`, `ucrt-x86_64`, `clang-x86_64`, and `clang-xi686`, each of these require the `$MINGW_PACKAGE_PREFIX` and `msys` and `clangarm-64` are lacking packages for some dependencies
<details>
<summary>Windows prerequisites</summary>
- Visual Studio 2022 (Enterprise / Professional / [Community (Free)](https://www.visualstudio.com/vs/community/))
- Desktop development with C++
- MSYS2 MinGW Toolchain. The toolchains with supported dependencies are `mingw-x86_64`, `mingw-xi686`, `ucrt-x86_64`, `clang-x86_64`, and `clang-xi686`, each of these require the `$MINGW_PACKAGE_PREFIX` and `msys` and `clangarm-64` are lacking packages for some dependencies
- sdl2 (only for UI client)
- freetype (can be disabled)
- fontconfig (can be disabled)
- libzip (>= 1.0)
- libpng (>= 1.2)
- speexdsp (only for UI client)
- curl (only if building with http support)
- nlohmann-json (>= 3.6.0)
- openssl (>= 1.0; only if building with multiplayer support)
- icu (>= 59.0)
- zlib
- gl (commonly provided by Mesa or GPU vendors; only for UI client, can be disabled)
- cmake
- benchmark (optional)
- innoextract (optional runtime dependency; used for GOG installer extraction during setup)
- libogg
- libvorbis
- flac
See the wiki for [the actual package names used in pacman](https://github.com/OpenRCT2/OpenRCT2/wiki/Building-OpenRCT2-on-MSYS2-MinGW).
</details>
<details>
<summary>macOS prerequisites</summary>
- Xcode Command Line Tools
- [Homebrew](https://brew.sh)
- CMake (available through Homebrew)
</details>
<details>
<summary>Linux prerequisites</summary>
- gcc (>= 7.1) or clang (>= 8.0.0) (for C++17 support)
- sdl2 (only for UI client)
- freetype (can be disabled)
- fontconfig (can be disabled)
@ -112,61 +149,42 @@ OpenRCT2 requires original files of RollerCoaster Tycoon 2 to play. It can be bo
- zlib
- gl (commonly provided by Mesa or GPU vendors; only for UI client, can be disabled)
- cmake
- benchmark (optional)
- innoextract (optional runtime dependency; used for GOG installer extraction during setup)
- libogg
- libvorbis
- flac
See the wiki for [the actual package names used in pacman](https://github.com/OpenRCT2/OpenRCT2/wiki/Building-OpenRCT2-on-MSYS2-MinGW).
### macOS:
- Xcode Command Line Tools
- [Homebrew](https://brew.sh)
- CMake (available through Homebrew)
Refer to https://github.com/OpenRCT2/OpenRCT2/wiki/Building-OpenRCT2-on-Linux#required-packages-general for more information about installing the packages.
### Linux:
- gcc (>= 7.1) or clang (>= 8.0.0) (for C++17 support)
- sdl2 (only for UI client)
- freetype (can be disabled)
- fontconfig (can be disabled)
- libzip (>= 1.0)
- libpng (>= 1.2)
- speexdsp (only for UI client)
- curl (only if building with http support)
- nlohmann-json (>= 3.6.0)
- openssl (>= 1.0; only if building with multiplayer support)
- icu (>= 59.0)
- zlib
- gl (commonly provided by Mesa or GPU vendors; only for UI client, can be disabled)
- cmake
- innoextract (optional runtime dependency; used for GOG installer extraction during setup)
Refer to https://github.com/OpenRCT2/OpenRCT2/wiki/Building-OpenRCT2-on-Linux#required-packages-general for more information about installing the packages.
</details>
---
## 3.2 Compiling and running
### Windows:
1. Check out the repository. This can be done using [GitHub Desktop](https://desktop.github.com) or [other tools](https://help.github.com/articles/which-remote-url-should-i-use).
2. Open a new Developer Command Prompt for VS 2022, then navigate to the repository (e.g. `cd C:\GitHub\OpenRCT2`).
3. To build the 64-bit version, use `msbuild openrct2.proj /t:build /p:platform=x64`.
<details>
<summary>Show instructions</summary>
To build the 32-bit version, use `msbuild openrct2.proj /t:build /p:platform=Win32`.
4. Run the game, `bin\openrct2`
1. Check out the repository. This can be done using [GitHub Desktop](https://desktop.github.com) or [other tools](https://help.github.com/articles/which-remote-url-should-i-use).
2. Open a new Developer Command Prompt for VS 2022, then navigate to the repository (e.g. `cd C:\GitHub\OpenRCT2`).
3. To build the 64-bit version, use `msbuild openrct2.proj /t:build /p:platform=x64`.
Once you have ran msbuild once, further development can be done within Visual Studio by opening `openrct2.sln`. Make sure to select the correct target platform for which you ran the build in point #3 (`Win32` for the 32-bit version, `x64` for the 64-bit version), otherwise the build will fail in Visual Studio.
To build the 32-bit version, use `msbuild openrct2.proj /t:build /p:platform=Win32`.
4. Run the game, `bin\openrct2`
Other examples:
```
set platform=x64
msbuild openrct2.proj /t:clean
msbuild openrct2.proj /t:rebuild /p:configuration=release
msbuild openrct2.proj /t:g2
msbuild openrct2.proj /t:PublishPortable
```
Once you have ran msbuild once, further development can be done within Visual Studio by opening `openrct2.sln`. Make sure to select the correct target platform for which you ran the build in point #3 (`Win32` for the 32-bit version, `x64` for the 64-bit version), otherwise the build will fail in Visual Studio.
Other examples:
```
set platform=x64
msbuild openrct2.proj /t:clean
msbuild openrct2.proj /t:rebuild /p:configuration=release
msbuild openrct2.proj /t:g2
msbuild openrct2.proj /t:PublishPortable
```
</details>
### macOS:
<details>
<summary>Show instructions</summary>
#### CMake:
CMake can build either a self-contained application bundle, which includes all the necessary game files and dependencies, or it can build a command line version that links against system installed dependencies. CMake will retrieve the dependencies from [Dependencies](https://github.com/OpenRCT2/Dependencies/) automatically. You can build the macOS app using CMake using the following commands:
```
@ -188,8 +206,12 @@ Then you can run the game by running `./openrct2`.
To link against system dependencies instead of letting CMake download the dependencies from [Dependencies](https://github.com/OpenRCT2/Dependencies), add `-DMACOS_USE_DEPENDENCIES=off` to your cmake args.
Detailed instructions can be found on [Building OpenRCT2 on macOS using CMake](https://github.com/OpenRCT2/OpenRCT2/wiki/Building-OpenRCT2-on-macOS-using-CMake).
</details>
### Linux:
<details>
<summary>Show instructions</summary>
The standard CMake build procedure is to install the [required libraries](https://github.com/OpenRCT2/OpenRCT2#linux), then:
```
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=. # set your standard cmake options, e.g. build type here - For example, -DCMAKE_BUILD_TYPE=RelWithDebInfo
@ -208,6 +230,7 @@ cd build
cmake .. -DCMAKE_INSTALL_PREFIX=. # set your standard cmake options, e.g. build type here - For example, -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build . --target install
```
</details>
---