physfs icon indicating copy to clipboard operation
physfs copied to clipboard

tvOS CMake erroneously links to IOKit

Open Ravbug opened this issue 1 year ago • 0 comments

When compiling SDL3 for tvOS using CMake, the configure script links to IOKit, causing this link error because IOKit is not present on tvOS:

ld: framework 'IOKit' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)

IOKit is not available when building for tvOS.

I made this quick-and-dirty patch in my own copy: https://github.com/icculus/physfs/blob/31209b7c2ce629dbda0db2329ce469ab9a2b90b9/CMakeLists.txt#L31

if(APPLE)
    if (NOT (CMAKE_SYSTEM_NAME MATCHES "tvOS"))
        set(iokit_lib "-framework IOKit")
    endif()
    set(OTHER_LDFLAGS ${OTHER_LDFLAGS} ${iokit_lib} "-framework Foundation")
    list(APPEND PHYSFS_M_SRCS src/physfs_platform_apple.m)
endif()

Ravbug avatar Apr 27 '24 17:04 Ravbug