cmake: Weak link with CoreHaptics

Add link to CoreHaptics so we can compile against latest iOS SDKs.
This commit is contained in:
okuoku 2021-04-11 19:29:01 +09:00 committed by Sam Lantinga
parent dbedaeceb3
commit 401f485490
1 changed files with 7 additions and 0 deletions

View File

@ -1742,6 +1742,7 @@ elseif(APPLE)
set(SDL_FRAMEWORK_COREMOTION 1) set(SDL_FRAMEWORK_COREMOTION 1)
endif() endif()
set(SDL_FRAMEWORK_GAMECONTROLLER 1) set(SDL_FRAMEWORK_GAMECONTROLLER 1)
set(SDL_FRAMEWORK_COREHAPTICS 1)
set(HAVE_SDL_SENSORS 1) set(HAVE_SDL_SENSORS 1)
else() else()
file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m) file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m)
@ -1966,6 +1967,12 @@ elseif(APPLE)
find_library(UIKIT UIKit) find_library(UIKIT UIKit)
list(APPEND EXTRA_LIBS ${UIKIT}) list(APPEND EXTRA_LIBS ${UIKIT})
endif() endif()
if(SDL_FRAMEWORK_COREHAPTICS)
find_library(COREHAPTICS CoreHaptics)
if(COREHAPTICS)
list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,CoreHaptics")
endif()
endif()
CheckPTHREAD() CheckPTHREAD()