Skip to content

Instantly share code, notes, and snippets.

@DevStefIt
Last active February 8, 2025 17:06
Show Gist options
  • Save DevStefIt/342b3b8b569f11e80ea7e2c10d13ac0d to your computer and use it in GitHub Desktop.
Save DevStefIt/342b3b8b569f11e80ea7e2c10d13ac0d to your computer and use it in GitHub Desktop.
Compiling SDL (Simple DirectMedia Layer) statically on Windows
# Make sure you opened the x64 Native Tools Command Prompt for VS 2022 and then opened MSYS2 shell command
echo Getting SDL...
git clone https://github.com/libsdl-org/SDL.git -b SDL2
cd ../build
mkdir SDL
cd SDL
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="../../installed/SDL" -DSDL_STATIC=ON -DSDL_SHARED=OFF ../../sources/SDL
cmake --build . --config Debug --target install
# Make sure you opened the x64 Native Tools Command Prompt for VS 2022 and then opened MSYS2 shell command
echo Getting SDL...
git clone https://github.com/libsdl-org/SDL.git -b SDL2
cd ../build
mkdir SDL
cd SDL
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="../../installed/SDL" -DSDL_STATIC=ON -DSDL_SHARED=OFF ../../sources/SDL
cmake --build . --config Release --target install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment