You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to build magnum for Emscripten via vcpkg via: vcpkg install --head corrade magnum[debugtools,gl,primitives,scenegraph,shaders,shaderconverter,shadertools]
It seems for Emscripten, Magnum uses a separate path that uses SDL_SetVideo, but Vcpkg resolves to SDL2 which means SDL_SetVideo is unavailable. I see in the non Emscripten path, SDL_CreateWindow is used instead which looks like the correct API for SDL2.
I'm intentionally not using the full SDL2 port in Emscripten, because it's significantly larger and none of those extra features are used. Which means, if Vcpkg enables the full SDL2 on Emscripten, Sdl2Application will fail to compile.
Currently I have no plans to support the full SDL2 on Emscripten due to the useless extra baggage that it drags in. The go-to application to use there is EmscriptenApplication instead, unfortunately it doesn't seem to be included in the feature list yet. You could try to add the following youself to "features" in vcpkg.json to enable it, together with changing the "default-features" to not include sdl2application anymore (and ideally include emscriptenapplication on Emscripten instead, but I have no idea if it's possible to express such condition there).
The Vcpkg package is maintained by the community, not by me personally, and the Emscripten support is rather fresh IIRC so a lot of things may be broken there. So this is unfortunately all I can offer right now. Hope it helps at least a bit :)
I had to patch the port to remove the sdl2application from default features and then add emscriptenapplication. It doesnt look like vcpkg has support for platform specific so I just updated a build script on my end to only include emscriptenapplication when I am building emscripten. It builds so far. Thanks!
mosra
changed the title
Cannot compile magnum for Emscripten via vcpkg head due to SDL2 issues
Update vcpkg packages to include EmscriptenApplication on Emscripten
Mar 4, 2023
Hi!
I am trying to build magnum for Emscripten via vcpkg via: vcpkg install --head corrade magnum[debugtools,gl,primitives,scenegraph,shaders,shaderconverter,shadertools]
It seems for Emscripten, Magnum uses a separate path that uses SDL_SetVideo, but Vcpkg resolves to SDL2 which means SDL_SetVideo is unavailable. I see in the non Emscripten path, SDL_CreateWindow is used instead which looks like the correct API for SDL2.
In the portfile for magnum, it seems like vcpkg actually applies a bunch of patches to make SDL match SDL2?
See https://github.com/microsoft/vcpkg/blob/master/ports/magnum/002-sdl-includes.patch
See https://github.com/microsoft/vcpkg/blob/master/ports/magnum/005-fix-find-sdl2.patch
The logs are:
The text was updated successfully, but these errors were encountered: