From 401f485490c68d91b8444f23f61b08e162ef04fb Mon Sep 17 00:00:00 2001 From: okuoku Date: Sun, 11 Apr 2021 19:29:01 +0900 Subject: [PATCH] cmake: Weak link with CoreHaptics Add link to CoreHaptics so we can compile against latest iOS SDKs. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0d20925b..91c6d8e23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1742,6 +1742,7 @@ elseif(APPLE) set(SDL_FRAMEWORK_COREMOTION 1) endif() set(SDL_FRAMEWORK_GAMECONTROLLER 1) + set(SDL_FRAMEWORK_COREHAPTICS 1) set(HAVE_SDL_SENSORS 1) else() 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) list(APPEND EXTRA_LIBS ${UIKIT}) endif() + if(SDL_FRAMEWORK_COREHAPTICS) + find_library(COREHAPTICS CoreHaptics) + if(COREHAPTICS) + list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,CoreHaptics") + endif() + endif() CheckPTHREAD()