cmake: Android always needs a native HIDAPI implementation

This commit is contained in:
Anonymous Maarten
2025-06-26 23:38:12 +02:00
committed by Anonymous Maarten
parent 279dabfc96
commit 89eef1bd34
2 changed files with 9 additions and 11 deletions

View File

@@ -1358,9 +1358,7 @@ if(ANDROID)
set(HAVE_SDL_HAPTIC TRUE)
endif()
if(SDL_HIDAPI)
CheckHIDAPI()
endif()
CheckHIDAPI()
if(SDL_JOYSTICK)
set(SDL_JOYSTICK_ANDROID 1)

View File

@@ -1108,6 +1108,14 @@ endmacro()
# Check for HIDAPI support
macro(CheckHIDAPI)
if(ANDROID)
enable_language(CXX)
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/android/hid.cpp")
endif()
if(IOS OR TVOS)
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/ios/hid.m")
set(SDL_FRAMEWORK_COREBLUETOOTH 1)
endif()
if(SDL_HIDAPI)
set(HAVE_HIDAPI ON)
if(SDL_HIDAPI_LIBUSB)
@@ -1140,14 +1148,6 @@ macro(CheckHIDAPI)
endif()
if(HAVE_HIDAPI)
if(ANDROID)
enable_language(CXX)
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/android/hid.cpp")
endif()
if(IOS OR TVOS)
sdl_sources("${SDL3_SOURCE_DIR}/src/hidapi/ios/hid.m")
set(SDL_FRAMEWORK_COREBLUETOOTH 1)
endif()
set(HAVE_SDL_HIDAPI TRUE)
if(SDL_JOYSTICK AND SDL_HIDAPI_JOYSTICK)