-
Notifications
You must be signed in to change notification settings - Fork 438
-
Notifications
You must be signed in to change notification settings - Fork 438
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
Using Magnum and SDL2 as git submodules #496
Comments
Hi! :)
Absolutely, similar thing is done for GLFW, Bullet, Assimp, SPIRV-Tools, glslang, ... Magnum has its own For SDL I tried a few years ago and it wasn't really possible yet. Since then I was waiting for SDL to get the CMake improvements this needed (which was blocked by SDL not being in git, which is solved now)... and it seems that SDL can do that now. Great! I have quite a big backlog of things to go through, but I'll be definitely looking into this when I have some time. Should be rather easy, so hopefully sometime early next week. |
Thank you very much. I appreciate you being able and willing to help with this. I'll check back next week to see if you need help with testing. |
Hi, I took a look at the commit log, and it looks like you're still busy with your backlog. Let me know if there's something I can help with, but otherwise I'll just wait until you have more time. Thanks again! |
Okay, finally got to this -- in 2968e58 (the The snippet suggests a static SDL by default, but it should work with a dynamic variant as well, and in that case also copy the built DLL to the If you confirm this is all working as expected, I'll merge that change to master. I still have some CI failures here and there but that shouldn't affect your case I hope. |
Getting closer! Using this branch here: https://github.com/jonesmz/osp-magnum/tree/sdl2 I downloaded the code on windows, then opened the project's cmake file with Visual Studio 2019.
The error seems to be:
I don't have GLFW (or SDL2) installed in windows. I have only SDL2 as a submodule of my git repository
Here's CMakeError.log
|
Ahah! My reading comprehension failed me. I see that you have recommended settings for SDL2. I've taken your settings suggestions, and now things are much happier :-) Got some linker errors to try to figure out. I'll report back if I can't convince it to cooperate.
|
Hrmm, so I'm able to make the GLFW errors go away if i update my SDL2 repo to the latest from the official github repo (now that they've migrated). It looks like maybe it's an issue with the detection of the pre-alias code from SDL2 in your .cmake file. Still getting the linker errors, looking into that now. Also getting a new warning: C:\Users\jonesmz\Source\Repos\jonesmz\osp-magnum\out\build\x64-Debug (default)\LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library |
Got it link with these settings:
|
Okay, I'm stupid, copypasted the DLL detection code from
Probably rather related to SDL_SHARED being turned off now, not to the repo update I think. Locally I tested with 2.0.14 and current master, didn't try with older versions.
|
Commit 62628be is now in Thanks in advance. |
Apologies for the delay. I'm able to build without any compiler or linker errors with both shared and static SDL2 configuration. This issue can be closed whenever you want. Thank you! |
Wonderful, thanks for the confirmation 🎉 |
Hi.
Some preliminaries:
This issue is reported against. I don't know why my project is using this specific commit, but it's working well for us until the next major release happens.
I can build SDL2 just fine out of the box, from the SDL2 repository mirror found here: https://github.com/SDL-mirror/SDL.git
No configuration changes needed. Just open Visual Studio and point it at the SDL2 cmake file.
I'm trying to use Magnum as a git submodule of my project, with the CMakeLists.txt from magnum included by my CMakeLists.txt using the cmake ADD_SUBDIRECTORY function.
This works great!
Next, I want to also add SDL2 as a git submodule, and build SDL2 at the same time as Magnum and my project.
Adding
This doesn't work. CMake complains with
It would be my expectation that Magnum's CMake files automatically detect SDL being built from the same CMake invocation.
Is this something that can be fixed in Magnum's CMake files? Or does my project need to change something?
The text was updated successfully, but these errors were encountered: