Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApplicationServices framework is not available on iOS? #470

Open
st235 opened this issue Sep 29, 2024 · 0 comments
Open

ApplicationServices framework is not available on iOS? #470

st235 opened this issue Sep 29, 2024 · 0 comments
Milestone

Comments

@st235
Copy link

st235 commented Sep 29, 2024

It appears that the ApplicationServices framework is linked across the entire Apple ecosystem in the CMakeLists.txt. When building for iOS both IOS and APPLE flags are defined, therefore ApplicationServices is linked to the target.

However, I believe it is not available on iOS, as generating an Xcode project with SDL3_image linked for iOS results in a build failure.

Screenshot 2024-09-29 at 17 24 19

I am wondering whether I am doing anything wrong or this is really a bug in the build script?

This is my CMakeLists.txt build script if of any use (some details are lifted for the sake of simplicity):

FetchContent_Declare(
    SDL_IMAGE
    GIT_REPOSITORY https://github.com/libsdl-org/SDL_image.git
    GIT_TAG main
    GIT_SHALLOW TRUE
    GIT_PROGRESS TRUE
)

FetchContent_MakeAvailable(SDL_IMAGE)

add_library(core INTERFACE)
target_sources(core INTERFACE
  src/app.h
  src/app.cpp
)
target_include_directories(core INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
target_link_libraries(core INTERFACE SDL3::SDL3 SDL3_image::SDL3_image)

And this is the build command I use

cmake -B out/ios -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES="arm64;i386;x86_64"

P.S.: the declaration of SDLIMAGE_BACKEND_IMAGEIO slightly hints that this is only related to Mac OS X.

cmake_dependent_option(SDLIMAGE_BACKEND_IMAGEIO "Use native Mac OS X frameworks for loading images" ON APPLE OFF)

P.P.S.: this stack overflow thread also suggests that ApplicationServices are not available in iOS.

P.P.P.S.: there is also an old unresolved SDL community thread with the similar issue

@slouken slouken added this to the 3.2.0 milestone Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants