SDL: Fix joystick (/dev/input/xxx) support on FreeBSD

From f8ad4abe4e3490c68380c507c9f3ee1c22a88639 Mon Sep 17 00:00:00 2001
From: Ganael Laplanche <[EMAIL REDACTED]>
Date: Sat, 22 Jun 2024 15:55:17 +0200
Subject: [PATCH] Fix joystick (/dev/input/xxx) support on FreeBSD

When switching to CMake, src/joystick/linux/SDL_sysjoystick.c file got
excluded from FreeBSD builds, losing support for /dev/input/xxx devices.

See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279907
---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6a31ed54f1bae..7ddb476c841ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1732,7 +1732,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
     if(FREEBSD OR NETBSD OR OPENBSD OR BSDI)
       CheckUSBHID()
     endif()
-    if(LINUX AND HAVE_LINUX_INPUT_H AND NOT ANDROID)
+    if((LINUX OR FREEBSD) AND HAVE_LINUX_INPUT_H AND NOT ANDROID)
       set(SDL_JOYSTICK_LINUX 1)
       sdl_glob_sources(
         "${SDL3_SOURCE_DIR}/src/joystick/linux/*.c"