| Summary: | Support building for UWP with CMake | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Jan Niklas Hasse <jhasse> |
| Component: | build | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | jhasse |
| Version: | HG 2.1 | ||
| Hardware: | x86 | ||
| OS: | Windows 10 | ||
| Attachments: | Adjust CMake files to support UWP | ||
|
Description
Jan Niklas Hasse
2020-09-14 18:08:49 UTC
Created attachment 4481 [details]
Adjust CMake files to support UWP
I've added CMake support using the SDL-UWP project as a blueprint. It compiles fine so far but fails with linker errors: 2>SDL.obj : error LNK2019: unresolved external symbol _exit referenced in function SDL_ExitProcess 2>SDL_winrtapp_common.obj : error LNK2019: unresolved external symbol "void __cdecl `eh vector destructor iterator'(void *,unsigned __int64,unsigned __int64,void (__cdecl*)(void *))" (??_M@YAXPEAX_K1P6AX0@Z@Z) referenced in function "public: void * __cdecl Microsoft::WRL::ComPtr<struct IUnknown>::`vector deleting destructor'(unsigned int)" (??_E?$ComPtr@UIUnknown@@@WRL@Microsoft@@QEAAPEAXI@Z) 2>SDL_winrtmouse.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z) ... This seems to be some sort of C runtime mismatch. I've found https://stackoverflow.com/questions/44826818/link-errors-when-trying-to-compile-against-an-old-std-library-and-windows-sdk so far. Any ideas? Can you try the latest SDL snapshot? http://www.libsdl.org/tmp/SDL-2.0.zip Thanks! I think you have https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/enable-winrt-cmake.patch in mind? I'm getting the same kind of linker errors with it (target SDL2, not SDL2-static). Actually the SDL2-static target works, if I set SDL_SENSOR to OFF. Awesome! See this patch: https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/0003-sdl2-fix-uwp-build.patch Patch added, thanks! https://hg.libsdl.org/SDL/rev/01a3c077ff1f |