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 - iOS build trying to find FORCEFEEDBACK library which is not available
Summary: iOS build trying to find FORCEFEEDBACK library which is not available
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: 2.0.8
Hardware: x86 Other
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-20 04:54 UTC by Steve Robinson
Modified: 2020-04-06 04:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!