leetal / ios-cmake

A CMake toolchain file for iOS/iPadOS, visionOS, macOS, watchOS & tvOS C/C++/Obj-C++ development
BSD 3-Clause "New" or "Revised" License
1.89k stars 448 forks source link

[bug] build config picks up host iconv and fails linking #119

Closed AJenbo closed 2 months ago

AJenbo commented 2 years ago

Describe the bug When building SDL2 the process will fail due to CMake seeing the host system iconv lib, and then failing to find a proper lib to link with at link time.

To Reproduce Steps to reproduce the behavior:

  1. Clone this PR https://github.com/diasurgical/devilutionX/pull/3612
  2. Run the build process

Expected behavior The build should successfully generate an iOS app.

Environment

leetal commented 2 years ago

Hi! I see that you merged the aforementioned PR. Did you solve this somehow yourself?

AJenbo commented 2 years ago

we endedup changing libsdl to first check for the ios specific one, and then avoid probing for the host lib if the first check fails. This isn't the most robust solution and only works out because it has another iconv implementation. If there where none and we had to fall back to SDL's own implementation this solution wouldn't have been possible.

https://github.com/libsdl-org/SDL/pull/5046/files