SDL3-3.4.0

#### Gaming Linux® From Scratch - Version 13.0

### Chapter 21. Miscellaneous

- Prev

  libxkbcommon-6f76d1 (1.13.1)

- Next

  sdl2-compat-2.32.64

- Up
- Home

# SDL3-3.4.0

## Introduction to SDL3

The Simple DirectMedia Layer Version 3 (SDL3 for short) is a cross-platform library designed to make it easy to write multimedia software, such as games and emulators. It is the new version of SDL and provides more features than SDL2.

- Download (HTTP): https://www.libsdl.org/release/SDL3-3.4.0.tar.gz

### SDL3 Dependencies

Required
CMake-4.2.3
Recommended
alsa-lib-1.2.15.3, libgbm-1.0.4, libxkbcommon-6f76d1 (1.13.1), libglvnd-1.7.0, PulseAudio-17.0, Vulkan-SDK-1.4.341.0, Wayland-Protocols-1.47, and Xorg Libraries (if those are not present, the corresponding modules are not built)

## Installation of SDL3

Install SDL3 by running the following commands:

    mkdir build &&
    cd    build &&

    cmake -D CMAKE_INSTALL_PREFIX=/usr \
          -D CMAKE_BUILD_TYPE=Release  \
          -D SDL_TEST_LIBRARY=OFF      \
          -D SDL_STATIC=OFF            \
          -D SDL_RPATH=OFF             \
          -W no-dev -G Ninja ..       &&

    ninja

Now, as the `root` user:

    ninja install

## lib32 Installation of SDL3

Install lib32-SDL3 by running the following commands:

    rm -rf * &&
    CC="gcc -m32" CXX="g++ -m32"         \
    PKG_CONFIG_PATH=/usr/lib32/pkgconfig \
    cmake -D CMAKE_INSTALL_PREFIX=/usr   \
          -D CMAKE_INSTALL_LIBDIR=lib32  \
          -D CMAKE_BUILD_TYPE=Release    \
          -D SDL_TEST_LIBRARY=OFF        \
          -D SDL_STATIC=OFF              \
          -D SDL_RPATH=OFF               \
          -W no-dev -G Ninja ..         &&

    ninja

Now, as the `root` user:

    DESTDIR=$PWD/DESTDIR ninja install      &&
    cp -vr DESTDIR/usr/lib32/* /usr/lib32   &&
    rm -rf DESTDIR                          &&
    ldconfig

## Command Explanations

### Note

For a full list of options and values, make sure you are in a build directory, then run cmake -LAH ...

`-D SDL_TEST_LIBRARY=OFF`: This parameter disables building an unnecessary static library meant for the tests. It gets built in the tests compilation.

`-D SDL_STATIC=OFF`: This parameter disables building static libraries.

`-D SDL_RPATH=OFF`: This parameter disables installing with rpath. It can cause security issues otherwise.

## Contents

Installed Programs: None
Installed Libraries: libSDL3
Installed Directories: /usr/include/SDL3 and /usr/lib/cmake/SDL3

### Short Descriptions

`libSDL3` | contains functions that provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D frame buffer across multiple platforms

- Prev

  libxkbcommon-6f76d1 (1.13.1)

- Next

  sdl2-compat-2.32.64

- Up
- Home