Skip to content

Building PCem on Windows

Michael Manley edited this page Dec 22, 2021 · 5 revisions

Building PCem on Windows

This guide will walk you through setting up a build environment for PCem. PCem uses the MSYS environment and MinGW-w64 for the compiler.

You can download MSYS from the following link, https://www.msys2.org/

First steps

You will need to install MSYS, this is very easy and the link above documents the initial setup very well. Once MSYS is installed, go ahead and open up an "MSYS MSYS2" command prompt. We will now install the required packages to compile PCem.

The command to do this is as follows

pacman -Sy mingw-w64-{i686,x86_64}-ntldd-git mingw-w64-{i686,x86_64}-toolchain mingw-w64-{i686,x86_64}-SDL2 mingw-w64-{i686,x86_64}-openal mingw-w64-{i686,x86_64}-wxWidgets mingw-w64-{i686,x86_64}-cmake

This will install everything you need for both a 32-bit and 64-bit compile.

After this we can check out and build the code.

Compile PCem

You can do in source or out of source builds. Personally I do my build in a build or build-<buildtype> but regardless it can be done in source as well.

We use CMake to generate the makefiles for PCem. Here is an example command to build a Release build, with networking. This is ran in the source directory

mkdir build && cd build
cmake -G "MSYS Makefiles" -DUSE_NETWORKING=ON -DCMAKE_BUILD_TYPE=Release ..
make

This will find all the dependencies and link accordingly. I do know if you are building on MSYS its recommended to use "MSYS Makefiles" for the generator, as this will find wxWidgets. For some reason using "MinGW Makefiles" or other ones that use that, it wont find the wxWidgets files. I will find a way to fix this issue, but for now use that cmake generator.

Once the build is complete, the binary is in output/bin/pcem. Any plugins that are not embedded into PCem will be in output/lib/pcem.

Clone this wiki locally