- C/C++ (from Microsoft)
- CMake Tools
- Native Debug
- CMake 3.16+.
- SDL2, including supplemental libraries: (platform-specific instructions for acquiring are given below)
- SDL2_Image
- C++ compiler that is highly compliant with the C++14 or higher standard.
- Need at minimum
std::make_unique
support.
- Need at minimum
SDL2 version 2.0.10 is already version-controlled in this repo, so nothing further needs to be done. If a different version is desired or you simply want to redownload the libraries, keep reading.
- Download the MSVC (Visual C++) development libraries from the SDL2 download page to an arbitrary location. MinGW is not currently supported.
- Unzip the zip archive and copy the
lib
,include
andCOPYING.txt
files/folders to3rdParty/SDL2/Windows/
. This is the location in which CMake searches to find SDL2 on Windows.
LuaJIT binaries are already version-controlled but just in case you need to do this again, here are the steps.
- Download the latest stable release ZIP of LuaJIT from the website. At the time of writing, the version used was 2.0.5.
- Extract the archive and open
src/msvcbuilt.bat
in your favourite text editor. - Append
/DLUAJIT_ENABLE_LUA52COMPAT
to the@set LJCOMPILE=
line. - Open up a tools-enabled cmd prompt targeting either x86 or x64 in the
src
folder and runmsvcbuild.bat
.
- For a 32-bit build (x86), use the "x64_x86 Cross Tools Command Prompt for Visual Studio" cmd prompt.
- For a 64-bit build (x64), use the "x64 Native Tools Command Prompt for Visual Studio" cmd prompt.
- Copy the lua51.dll, lua51.lib and lua51.exp files to
3rdParty/lua/Windows/lib/x64
folder (do the corresponding step for x86). - Copy the lua.h, lualib.h, lauxlib.h, luajit.h files to
3rdParty/lua/Windows/include
.
You should be good to go.
From the project root, run: cmake -B build
. If you want to use a specific MSVC IDE version, do cmake -B build -G <VS Version>
, for example for VS 2017, cmake -B build -G "Visual Studio 15 2017"
.
- Open up the generated solution file
build\pen31ope.sln
in the correct Visual Studio IDE version that corresponds to the version you used to generate build files in the step above. - Right-click on the
pen31ope
entry in the Solution Explorer and set it as the default startup target. - Press F5.
- Download the development libraries from the SDL2 download page to an arbitrary location. This is normally a
.dmg
file. - Open the
.dmg
and copy theSDL2.framework
package to your desired macOS frameworks directory. Normally, this would be/Library/Frameworks
but user-specific locations like~/Library/Frameworks
are fine as well.
- Download the development libraries from the SDL2_Image download page to an arbitrary location. This should also be a
.dmg
file. - Open the
.dmg
and copy theSDL2_Image.framework
package to the same macOS frameworks directory as done earlier.
- From the project root, run:
cmake -B build
. - Change to the
build
directory and runmake
.
- If not already in
build
directory, change to it:cd build
. - Run
./pen31ope [params]
.
sudo apt-get install libsdl2-dev
As of time of writing, your default g++ compiler might be version 4.8.x which doesn't appear to have complete C++14 support, such as for std::make_unique
which is used a lot in the project. It is recommended to use g++ version 5+ or clang version 3.4+.
To obtain g++ 5+, if your Ubuntu distro is too old you'll have to install it from a PPA.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
# To set first priority to gcc-5/g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
- For GCC, run
cmake -B build
. For clang, runCC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -B build
. - Change to the
build
directory and runmake
.
- If not already in
build
directory, change to it:cd build
. - Run
./pen31ope [params]
.