-
Notifications
You must be signed in to change notification settings - Fork 2k
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
CMake issues when linking to SDL3::SDL3-shared #12057
Comments
I think you're seeing a CMake quirk. I'd argue it is even a (small) CMake bug. Let's dissect your second set of commands cmake -S . -B build This will configure SDL with the default build type. Because you have not configured one (using
This will build SDL. Because you are building on Linux with a CMake generator that does not support multiple configurations (
This will install SDL to the prefix folder with Release configuration. CMake should ignore Using |
(but you'll need |
Yes! You need it with Multi-Config generators: Visual Studio on Windows, or Ninja Multi-Config on all platforms. |
I've created an issue on the CMake bug tracker here. Perhaps this is expected behavior. |
@madebr Thanks for the clarification (and for opening the CMake issue)! I agree with your statement in the CMake issue report that the most sensible solution would be that CMake emits an error. As it stands, a quite basic chain of commands that is perfectly valid for some generators (like VS) will generate broken installations for other generators without even giving the user any information that something possibly went wrong. |
First of all, congratulations on the release of SDL 3.2.0!
I tried linking my application to SDL3::SDL3-shared via CMake, but encountered some weird behavior on Ubuntu 22.04.
When building SDL3 as follows...
... everything works as it should. However, when I instead use the following commands to build SDL3:
... then I encounter the following error when trying to link to SDL3 in my application:
Please find the output of diff for the two generated
lib/cmake/SDL3/SDL3sharedTargets-release.cmake
files attached. While this is not a huge issue for me (after all, I can just use the former command for building SDL), it might still an issue that should eventually be fixed.Some system information:
The text was updated successfully, but these errors were encountered: