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

sdl_mixer: link AudioUnit only on macOS #25965

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kambala-decapitator
Copy link
Contributor

@kambala-decapitator kambala-decapitator commented Nov 16, 2024

Summary

Changes to recipe: sdl_mixer/2.8.0

Motivation

Fixes linker error in iOS project that consumes sdl_mixer

Details

AudioUnit framework is available only for macOS, on iOS you'd receive

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

@AbrilRBS AbrilRBS self-assigned this Nov 18, 2024
@AbrilRBS
Copy link
Member

Thanks for the clear message error, we appreciate it! :)

Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im trying to understand one thing:

  • Upstream's CMakeLists has this line target_link_libraries(SDL2_mixer PRIVATE -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices) with only an if(APPLE) condition
  • https://developer.apple.com/documentation/audiounit/ lists OS 2.0+ iPadOS 2.0+ Mac Catalyst 13.0+ macOS 10.0+ tvOS 9.0+ visionOS 1.0+

Which confuses me a bit as to how this would be working upstream (Maybe they just dont test for ios specifically?) and if there are other apple os that would need this framework besides just macos

@kambala-decapitator
Copy link
Contributor Author

Yes, that's rather strange. I've just checked in a test iOS project in Xcode: you can select AudioUnit from the list of system frameworks, but on build you receive linker error:

Screenshot 2024-11-18 at 15 33 43

This seems to be the explanation: https://stackoverflow.com/a/14120936

will check upstream behavior later today.

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

Successfully merging this pull request may close these issues.

2 participants