-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[sdl2-mixer] Fix features dependency link. #8208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing that so fast!
Unfortunately doesn't work. See the inline comments.
Also it doesn't look like the libraries are considered a dependency by CMake, so then won't be installed by default when installing something using SDL2-mixer. I'd gladly do it myself but I have no idea how to achieve that
@Vermeille If we want them to be the default feature, I will add them. |
@JackBoosY I'm not sure I explained myself clearly. I don't think SDL2_mixer should be built with any optional dependency by default. However, if we select mpg123 as a vcpkg feature, then obviously SDL2_mixer should be built with the mpg123 functionality (done with activating the feature macro at build time), and considered by cmake as a dependency, so that when installing a project (like here ), sdl2_mixer is seen as a dependency of the project (and have sdl libs installed) and mpg123 is seen as a dep of SDL2_mixer (thus installing mpg123 libs as well). |
@Vermeille We can use two way to solve this issue:
@lethal-guitar What do you think? |
Yes. I understand that. But there are two dependecies at play:
While I don't care about the dependencies of the library since I will not change what sdl2 mixer addons will be used after installation, I do care much about what CMake's I've been trying to suggest, maybe with poor wording, that removing the addons as a link dependency of the library is a fine and probably best, but they should still be considered deps by cmake to get installed along sdl2 mixer So it definitely looks like your solution 2 is what I'm after, if we can have cmake copy dependencies correctly with sdl2 mixer. |
@Vermeille Even though sdl2-mixer does not handle the installation process, vcpkg does this because vcpkg builds these dependencies before building sdl2-mixer and installs them in the same directory with sdl2-mixer. And when you need to export sdl2-mixer, vcpkg will also export them, so you don't need to care about them. Unless you use other tools to run |
@JackBoosY I use CPack. Is this wrong? |
@Vermeille Well, that's the difference between us. If we add these |
@JackBoosY Thank you for this clarification. I will investigate how to use |
@LilyWangL sorry for the late response. I'm happy to do some testing, but won't get around to it until next week. @JackBoosY solution 2 sounds like the right one to me as well. |
Whatever was done to SDL2-Mixer has broken it on win64. Tons of unresolved symbols now. |
Can confirm broken on x64
|
@timautry Found linking against ports/sdl2-mixer/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ports/sdl2-mixer/CMakeLists.txt b/ports/sdl2-mixer/CMakeLists.txt
index 96529d096..ced7b4061 100644
--- a/ports/sdl2-mixer/CMakeLists.txt
+++ b/ports/sdl2-mixer/CMakeLists.txt
@@ -34,8 +34,10 @@ endif()
# Ogg-Vorbis support
if(SDL_MIXER_ENABLE_OGGVORBIS)
find_path(VORBIS_INCLUDE_DIR vorbis/codec.h)
+ find_library(VORBIS_LIB vorbisfile)
list(APPEND SDL_MIXER_INCLUDES ${VORBIS_INCLUDE_DIR})
list(APPEND SDL_MIXER_DEFINES MUSIC_OGG)
+ list(APPEND SDL_MIXER_LIBRARIES ${VORBIS_LIB})
endif()
# Opus support |
Thanks Vultraz, but there's no change - same 47 unresolved symbols. |
After delving into the code, I found that using dynamic links must define |
Fix features dependency link.
Related PR: #7720.
@Vermeille @lethal-guitar Could you test this?
Thanks.