When using GitHub - allyourcodebase/SDL: SDL with the build system replaced by Zig on linux in my build, I get a whole lot of errors like this:
... SDL_config.h.cmake: 540 unable to substitute variable: error: MissingValue
Anyone knows how can I fix this? What am I missing?
I’m unable to reproduce this on Linux Mint 21.3 - can you say more about what your system/distribution looks like?
Note that there’s limited value in building it on Linux, since most distros have it packaged, and in fact they have it packaged with the ideal backends for that distro. Even if you compile SDL statically on Linux, you will then have to dynamically link x11 or wayland and opengl or vulkan. By depending on system SDL, you let the distro figure that stuff out for you.
I’m not happy with this being the status quo - I would love to be able to distribute statically linked applications that use the graphics driver. But here we are. My suggestion is to link system SDL when targeting Linux.
I’m using NixOS 24.05. I achieved a build by adding every missing CMake variables for the config header into SDL’s build.zig. That’s also why I’m suprised that you could build without any modifications to the build script
I am definitely going to do this from now on. I replaced cmake with zig build for the new SDL3 to see how it would go and Linux was a hassle compared to Windows.
Thank you for your answer!