Fix sdl2-gfx, sdl2-image, sdl2-mixer, sdl2-net, and sdl2-ttf forcing debug lib first (SDL2d)#5948
Conversation
|
Could you also bump the CONTROL version number up to |
0af2cb5 to
1024083
Compare
|
I am seeing a new build failure on |
I suppose you're referring to the Vcpkg-PR-Eager failure? It seems I'm not authorized to access it. It asks me to log in with a Microsoft account; but when I use the same one that I use to sign into Visual Studio, it tells me: |
|
I haven't been able to look at the tests, but I did take a look at the CMakeLists.txt files under ports/ for sdl2-gfx, sdl2-ttf, sdl2-image, and sdl2-mixer, and all of these do the same thing as sdl2-net. They all search for the SDL2 lib like so: In my case, I'm using sdl2-net, and what ends up happening is that because it searches for SDL2d before SDL2, it ends up finding it: As you can see, my Release build picks up SDL2d.lib. It also picks up SDL2.lib below, but that comes from my dependency on sdl2 directly. I'm not sure what the right solution is. I tried something else: I modified the sdl2-net port CMakeLists.txt so that instead of |
|
Looks like Vcpkg-PR-Eager has passed on this second commit. If you think this is good, I could apply this same fix to sdl2-gfx, sdl2-ttf, sdl2-image, and sdl2-mixer. |
|
This looks good to me. Do you want to apply the other changes in this PR? |
Alright, will do, Note that I don't use the other libs, so we'll have to rely on the tests, but really, if it works for one, it should work for the others. |
|
Btw, I didn't get a response about not being able to access Vcpkg-PR-Eager. Is there something I need to do? |
|
Vcpkg-PR-Eager is hosted on a Microsoft Internal Azure DevOps instance, its access is not controlled by the vcpkg team so we have been pasting the results into PRs. We are working through the steps to get it moved to https://dev.azure.com/vcpkg/ where we will be able to open it up to the community. This will hopefuly happen soon. |
|
@amaiorano: What about conditionally linking to if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
# instruct CMakeLists.txt to link to: SDL2::SDL2-static
else()
# instruct CMakeLists.txt to link to: SDL2::SDL2
endif()EDIT: Whoops. Didn't realize this was in CMakeLists.txt files, and not the port file. Checking |
Ah, I thought vcpkg only created static libraries. I didn't know about VCPKG_LIBRARY_LINKAGE. I can certainly do as you propose. @Rastaban does that make sense to you as well? |
|
TBH, I don't even understand why SDL2 would require us to specify either SDL2-static or just SDL2 - can't it figure it out based on the CMake environment? Locally, I tried modifying my project to use SDL2::SDL2, despite only building static libs in vcpkg, and it worked... |
|
vcpkg has a wrapper-workaround (in the SDL2 port: see I suppose we could just rely on the presence of that wrapper, and keep things as they are? |
…debug lib first (SDL2d)
f9d78f1 to
9595e28
Compare
|
Okay, I added support for both static and dynamic SDL2 libs. I've squashed all and force pushed, updated title, etc. Hopefully this passes tests. @past-due would you be able to test this locally as well? |
|
@amaiorano: I'm not sure that @Rastaban: Thoughts on this (and the above)? Should we bother trying to configure the "appropriate" SDL2 target by linkage, or just pick one and rely on the |
|
What about using the CMake official (but reversed in logic ;) ) |
|
will probably be solved by #5543 |
|
Hey everyone, So do we wait for #5543 to land, or do we proceed with this change? |
|
I lean towards waiting for the other PR to land. |
|
#5543 does not actually resolve the issue this PR is addressing. I'm still looking at the static/dynamic question more closely before merging. |
|
Thanks for wrapping this up and merging! |


When using sdl2-net on Windows, release builds end up linking against SDL2d.lib since it comes first in find_library. Removing all of this since it's not necessary. If using SDL2-net, it's reasonable to assume the client is already also linking against SDL2. Note that this was Windows-only, so for cross-platform builds, explicitly linking against SDL2 was already necessary.