libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.
zlib License
435 stars 147 forks source link

CMake: Native MIDI for macOS: frameworks are added as link_options instead of as link_libraries #453

Closed maxmitti closed 2 years ago

maxmitti commented 2 years ago

With CMake under macOS, the frameworks needed for native MIDI are added as link_options instead of linked with target_link_libraries here: https://github.com/libsdl-org/SDL_mixer/blob/main/CMakeLists.txt#L728

This leads to the issue, that the frameworks are not exported into the CMake library configuration files, which leads to undefined references when linking to a static build of SDL2_mixer.

In SDL2, frameworks are linked with target_link_libraries, which seems to fix this problem. See for example here:

madebr commented 2 years ago

I opened https://github.com/libsdl-org/SDL_mixer/pull/455 to address this.

Thanks for letting us know about this issue!