Skip to content

Conversation

icculus
Copy link
Collaborator

@icculus icculus commented Sep 12, 2025

Looks like this:

-- Enabled backends:
--   Video drivers: dummy kmsdrm(dynamic) offscreen wayland(dynamic) x11(dynamic)
--   X11 libraries: xcursor xdbe xfixes xinput2 xrandr xscrnsaver xshape xsync xtest
--   Render drivers: gpu ogl vulkan
--   GPU drivers: vulkan
--   Audio drivers: alsa(dynamic) disk dummy jack(dynamic) pipewire(dynamic) pulseaudio(dynamic) sndio(dynamic)
--   Joystick drivers: hidapi linux virtual

Fixes #7922.

This was the most compact way I could think to do this (iterate over all CMake vars with regex) without sprinkling changes all over the project files.

CC @madebr, who I will allow to completely reject this entire approach, or just the idea of doing it at all. But I really do miss this from SDL2's configure script.

@icculus icculus requested a review from madebr September 12, 2025 00:08
Looks like this:

```
-- Enabled backends:
--   Video drivers: dummy kmsdrm(dynamic) offscreen wayland(dynamic) x11(dynamic)
--   X11 libraries: xcursor xdbe xfixes xinput2 xrandr xscrnsaver xshape xsync xtest
--   Render drivers: gpu ogl vulkan
--   GPU drivers: vulkan
--   Audio drivers: alsa(dynamic) disk dummy jack(dynamic) pipewire(dynamic) pulseaudio(dynamic) sndio(dynamic)
--   Joystick drivers: hidapi linux virtual
```

Fixes libsdl-org#7922.
@icculus icculus force-pushed the sdl3-cmake-list-backends branch from ce40e31 to 91ecab5 Compare September 12, 2025 13:29
Copy link
Contributor

@madebr madebr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little brittle because it depends on variable naming, but if this list is sufficient for you, then lgtm.

Your approach opened my eyes to alternatives what require sprinkling around function calls to register subsystems.

Co-authored-by: Anonymous Maarten <[email protected]>
@icculus icculus merged commit 1c784c4 into libsdl-org:main Sep 12, 2025
2 checks passed
@icculus icculus deleted the sdl3-cmake-list-backends branch September 12, 2025 18:59
@icculus icculus added this to the 3.4.0 milestone Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cmake: list chosen audio/video/etc targets at the end of the output
3 participants