Add support for SDL3 joystick input driver

Made possible by EIREXE, xsellier and the SDL team.

This commit includes statically linked SDL3 for Windows, Linux and macOS.
The vendored copy of SDL3 was setup to only build the required subsystems
for gamepad/joystick support, with some patches to be able to make it as
minimal as possible and reduce the impact on binary size and code size.

Co-authored-by: Álex Román Núñez <eirexe123@gmail.com>
Co-authored-by: Xavier Sellier <xsellier@gmail.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
This commit is contained in:
Nintorch 2025-05-28 14:22:20 +05:00 committed by Rémi Verschelde
parent 987832be46
commit 0b3496fb4f
No known key found for this signature in database
GPG key ID: C3336907360768E1
330 changed files with 154930 additions and 1561 deletions

View file

@ -394,6 +394,18 @@ def configure(env: "SConsEnvironment"):
else:
env["udev"] = False # Linux specific
if env["sdl"]:
if env["builtin_sdl"]:
env.Append(CPPDEFINES=["SDL_ENABLED"])
elif os.system("pkg-config --exists fontconfig") == 0: # 0 means found
env.ParseConfig("pkg-config sdl3 --cflags --libs")
env.Append(CPPDEFINES=["SDL_ENABLED"])
else:
print_warning(
"SDL3 development libraries not found, and `builtin_sdl` was explicitly disabled. Disabling SDL input driver support."
)
env["sdl"] = False
# Linkflags below this line should typically stay the last ones
if not env["builtin_zlib"]:
env.ParseConfig("pkg-config zlib --cflags --libs")