This project utilises git submodules. To both clone this and the required submodules
run git clone --recurse-submodules https://github.com/mhwdvs/sdl2-boilerplate
Alternatively, you can run git submodules init && git submodules update
if you have already cloned the repo without
submodules
Generally;
Initialise git lfs by running: git lfs install
Debian/Ubuntu:
sudo apt install git cmake ninja-build xorg-dev libwayland-dev wayland-protocols extra-cmake-modules build-essential autoconf automake libtool pkg-config libasound2-dev libpulse-dev libaudio-dev libjack-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libdecoration0-dev
Fedora
sudo dnf install git cmake ninja-build libasan libubsan SDL2-devel freeglut-devel mesa-libGL-devel libXi-devel libXcursor-devel libXrandr-devel libX11-devel
TODO
Those mentioned above, as well as;
In addition, to debug with MSVC's address sanitiser you will need to add the relevant ASAN DLL to your system PATH environment variable. Read more
Generate Ninja build files:
cmake -S . -B build --DCMAKE_BUILD_TYPE=Release -G Ninja
If you'd like to enable all available sanitisers for your compiler (ASanitizer, UBSan, LSan), you may also add
the -DSANITISERS=ON
variable to your CMake configuration command
Build with Ninja
cmake --build build
Because FreeGLUT is bad, you will need to repeat this process (Generate + Build) twice for your configuration to work.
cd build/src/ && ./Main
cd build/src/ && Main.exe
Generally;