-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Building OpenRCT2 on MSYS2 MinGW
Required libraries include:
Package | Note(s) |
---|---|
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. |
openssl |
>= 1.0; Only if building with multiplayer support. |
icu |
>= 59.0 |
zlib |
|
mesa |
Only for UI client, can be disabled. |
cmake |
|
nlohmann-json |
>= 3.6.0 |
duktape |
Unless scripting is disabled. |
benchmark |
Optional. |
innoextract |
Optional runtime dependency; used for GOG installer extraction during setup |
libvorbis |
|
libogg |
|
flac |
All required packages are compiled for use in a singular MSYSTEM each, see below for each MSYSTEM's copy of these packages.
Additionally, you can add support for Discord's Rich Presence API by cloning https://github.com/discordapp/discord-rpc into the root clone directory. Do note discord-rpc requires rapidjson, which don't bother fixing their bugs and you may need the hackish workaround: janisozaur/rapidjson/commit/20f8604ee6cd078c1cb2346148c69c0c2c160db2
pacman -S mingw-w64-x86_64-{SDL2,freetype,fontconfig,libzip,libpng,speexdsp,curl,openssl,icu,zlib,mesa,cmake,nlohmann-json,duktape,libvorbis,libogg,flac}
And optionally
pacman -S mingw-w64-x86_64-{benchmark,innoextract}
pacman -S mingw-w64-i686-{SDL2,freetype,fontconfig,libzip,libpng,speexdsp,curl,openssl,icu,zlib,mesa,cmake,nlohmann-json,duktape,libvorbis,libogg,flac}
And optionally
pacman -S mingw-w64-i686-{benchmark,innoextract}
pacman -S mingw-w64-ucrt-{SDL2,freetype,fontconfig,libzip,libpng,speexdsp,curl,openssl,icu,zlib,mesa,cmake,nlohmann-json,duktape,libvorbis,libogg,flac}
And optionally
pacman -S mingw-w64-ucrt-x86_64-{benchmark,innoextract}
pacman -S mingw-w64-clang-{SDL2,freetype,fontconfig,libzip,libpng,speexdsp,curl,openssl,icu,zlib,mesa,cmake,nlohmann-json,duktape,libvorbis,libogg,flac}
And optionally
pacman -S mingw-w64-clang-{benchmark,innoextract}
pacman -S mingw-w64-clang-i686-{SDL2,freetype,fontconfig,libzip,libpng,speexdsp,curl,openssl,icu,zlib,mesa,cmake,nlohmann-json,duktape,libvorbis,libogg,flac}
And optionally
pacman -S mingw-w64-clang-i686-{benchmark,innoextract}
MSYS2's default cmake
configuration uses ninja
, but also provides options the option to use GNU Make
mkdir build && cd build
cmake -G "MinGW Makefiles" .. # Remember to set your build flags, e.g. -DCMAKE_BUILD_TYPE=RelWithDebInfo, you must specify the generator if you want to use make and not ninja
mingw32-make
This will generate a openrct2
binary in the build
directory. To run you have two options: make install
or running it locally.
mingw32-make install
will download required resources (json objects, title sequences) and installs openrct2 under /usr/local
by default, but DESTDIR
will be properly honoured (see below).
Alternatively you can install the required resources manually so can launch openrct2 from the project directory.
You need a functional data
directory next to the current working directory when you start openrct2
.
An easy way to generate such a data directory is by leveraging make install
. Type the following in the build
directory:
DESTDIR=. make install
Alternatively you can install these assets yourself. The following needs to satisfied:
-
$build/data/
has to have contents of$repo/data/
-
$build/data/g2.dat
needs to exist. Build it usingmake g2
and then copy it intodata
. -
$build/data/object
has to have the extracted contents from https://github.com/OpenRCT2/objects/releases - (optional)
$build/data/title
has to have extracted contents from https://github.com/OpenRCT2/title-sequences/releases
$XDG_CONFIG_HOME/OpenRCT2/
(or ~/.config/OpenRCT2/
in its absence) has to have config.ini
with game_path
set to an RCT install. openrct2
will ask you for this directory when it first starts.
Keep in mind you can symlink stuff and that filesystems are case sensitive!
Alternatively you can specify the data directory like this:
./openrct2 --openrct-data-path=../data
OR
Just symlink the data
directory in the current build
directory, which is the easiest approach for development
ln -s ../data data
Building with clang works the same way as building with GCC, you just need to change the CXX environment variable. Keep in mind, that you need to have an empty build directory as cmake will not switch compilers after it has already generated a Makefile.
mkdir build && cd build
export CXX=$(which clang++) # OpenRCT2 is purely a C++ project, there's no need to set CC
cmake ..
make
See the optimization note above.
If you prefer to use ninja just run cmake without the -G flag:
mkdir build && cd build
cmake .. # Any other arguments you want, for example -DCMAKE_BUILD_TYPE=RelWithDebInfo
ninja # No need to specify parallel, it does that automatically
DESTDIR=. ninja install
#6658 added support for discord-rpc, Discord's Rich Presence client library. It gets automatically picked up when cloned into the root of repository.
That should work, but it might require a little debugging. This is still quite finicky at the end of the day.
- Home
- FAQ & Common Issues
- Roadmap
- Installation
- Building
- Features
- Development
- Benchmarking & stress testing OpenRCT2
- Coding Style
- Commit Messages
- Data Structures
- CSS1.DAT
- Custom Music and Ride Music Objects
- Game Actions
- G1 Elements Layout
- game.cfg structure
- Maps
- Music Cleanup
- Objects
- Official extended scenery set
- Peep AI
- Peep Sprite Type
- RCT1 ride and vehicle types and their RCT2 equivalents
- RCT12_MAX_SOMETHING versus MAX_SOMETHING
- Ride rating calculation
- SV6 Ride Structure
- Settings in config.ini
- Sizes and angles in the game world
- Sprite List csg1.dat
- Sprite List g1.dat
- Strings used in RCT1
- Strings used in the game
- TD6 format
- Terminology
- Track Data
- Track Designs
- Track types
- Vehicle Sprite Layout
- Widget colours
- Debugging OpenRCT2 on macOS
- OpenGL renderer
- Overall program structure
- Rebase and Sync fork with OpenRCT2
- Release Checklist
- Replay System
- Reverse Engineering
- Using minidumps from crash reports
- Using Track Block Get Previous
- History
- Testing