We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4143

Summary: iOS build trying to find FORCEFEEDBACK library which is not available
Product: SDL Reporter: Steve Robinson <ssrobins>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.8   
Hardware: x86   
OS: Other   

Description Steve Robinson 2018-04-20 04:54:00 UTC
I am trying to build SDL2 in CMake for iOS on Mac OS X 10.11.6 with Xcode 8.2.1 installed.

I'm using the ios toolchain found here:
https://github.com/leetal/ios-cmake/

Here's my CMake command:
cmake -DCMAKE_TOOLCHAIN_FILE=../games/iOS/ios.toolchain.cmake  ../games
Where ../games is the source directory

I get this CMake configuration error:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FORCEFEEDBACK
    linked by target "SDL2-static" in directory /Users/steve/Documents/games_ios_build/3rdparty/SDL2/SDL2-2.0.8

-- Configuring incomplete, errors occurred!


This is expected based on Apple's doc indicating it's only part of the macOS SDK:
https://developer.apple.com/documentation/forcefeedback
Compare it to the IOKit Framework, which is listed for both iOS and macOS
https://developer.apple.com/documentation/iokit

When I comment out list(APPEND EXTRA_LIBS ${FORCEFEEDBACK}) for the iOS build, SDL2 built fine so it doesn't even seem to use this library.  Therefore, my suggestion is to omit the library on iOS:

The current code block in the main CMakeLists.txt file:
  if(SDL_FRAMEWORK_FF)
    find_library(FORCEFEEDBACK ForceFeedback)
    list(APPEND EXTRA_LIBS ${FORCEFEEDBACK})
  endif()

After the change:
  if(SDL_FRAMEWORK_FF AND NOT IOS)
    find_library(FORCEFEEDBACK ForceFeedback)
    list(APPEND EXTRA_LIBS ${FORCEFEEDBACK})
  endif()
Comment 1 Steve Robinson 2020-04-06 04:53:29 UTC
It's fixed in SDL 2.0.12. Thanks!