From 4a43321c81c085a11652188cd118a884a6c85814 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 23 Feb 2022 18:10:02 +0300 Subject: [PATCH] cmake: Fix bug #5361. src/joystick/*.c wasn't unconditionally added to source list even though joystick is an SDL subsystem. Also removed the `SDL_JOYSTICK AND NOT APPLE` condition from src/joystick/dummy/*.c source addition: the OSX unresolved symbols issue, if it really is there, should be fixed separately. Fixes https://github.com/libsdl-org/SDL/issues/5361, i.e. build failures when SDL_JOYSTICK and SDL_HAPTIC are disabled. --- CMakeLists.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26fc3309b..1561ca270 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -471,6 +471,7 @@ file(GLOB SOURCE_FILES ${SDL2_SOURCE_DIR}/src/dynapi/*.c ${SDL2_SOURCE_DIR}/src/events/*.c ${SDL2_SOURCE_DIR}/src/file/*.c + ${SDL2_SOURCE_DIR}/src/joystick/*.c ${SDL2_SOURCE_DIR}/src/haptic/*.c ${SDL2_SOURCE_DIR}/src/hidapi/*.c ${SDL2_SOURCE_DIR}/src/libm/*.c @@ -961,10 +962,6 @@ foreach(_SUB ${SDL_SUBSYSTEMS}) set(SDL_${_OPT}_DISABLED 1) endif() endforeach() -if(SDL_JOYSTICK) - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) -endif() if(SDL_HAPTIC) if(NOT SDL_JOYSTICK) # Haptic requires some private functions from the joystick subsystem. @@ -2558,10 +2555,8 @@ if(NOT HAVE_SDL_VIDEO) endif() if(NOT HAVE_SDL_JOYSTICK) set(SDL_JOYSTICK_DUMMY 1) - if(SDL_JOYSTICK AND NOT APPLE) # results in unresolved symbols on OSX - file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c) - set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) - endif() + file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) endif() if(NOT HAVE_SDL_HAPTIC) set(SDL_HAPTIC_DUMMY 1)