This is an incredibly basic project template for C/C++ with SDL2, SDL2_image, SDL2_ttf, and SDL2_mixer. It is setup to use CMake to build on Linux and on Windows (with MinGW).
apt-get install cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-dev
mkdir -p config && mkdir -p assets
cd lib && ./clone_libs.sh
Cross-compiling for Windows on Linux requires the same basic setup of MinGW as native Windows builds. Install MinGW on Linux and either cross-compile all of the SDL2 libs or download and extract the prebuilt MinGW versions.
- Install Git Bash: https://git-scm.com/downloads
- Install MingGW-w64: http://mingw-w64.org/doku.php
- Install CMake: https://cmake.org/download/
- Download and install the SDL2 dev libraries for MinGW and extract them into the MinGW installation folder, e.g. C:/../MinGW/
- Add the MinGW and the MinGW/bin folders to your PATH.
Native: ./scripts/build_linux_native.sh
Cross-compile for Windows: ./scripts/build_windows_cross.sh
Use Git Bash: ./scripts/build_windows_native.sh
Note: Windows binaries will require a bunch of DLLs alongside in order to run on other machines (i.e. a machine without the dev libraries on the PATH)
- Change the project name in the top-level CMakeLists.txt file
- Visual Studio builds
- Mac OS support
- Cross-compiling
- Automate zipping up binary and DLLs for windows builds