libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
10.21k stars 1.86k forks source link

Sanity check for CMake Configures #10610

Open Ravbug opened 3 months ago

Ravbug commented 3 months ago

On Linux in particular, it is easy to accidentally configure SDL without video or audio capabilities if the user does not install the necessary dependency libraries. A sanity check that triggers a fatal error during the configure process if at least one video and audio backend is not enabled would help with this. It could be gated by a CMake option that defaults to ON

Creating this issue at the request of @madebr after a discussion on Discord.

namandixit commented 3 months ago

One additional flag/mode can be to make sure that ALL supported backends are available. This will help in compiling the most compatible SDL that can be shipped in absence of Steam Runtime and such.

icculus commented 1 month ago

We added a CMake warning if on Unix and neither X11 or Wayland is enabled in 723c1cc5b36a445e5dd9fc2e58f551705be53089. Do we need anything more on this?

Ravbug commented 1 month ago

I think it would also be good to check that at least one audio backend (alsa, jack, pulseaudio, ...) is enabled.