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()