Build issue with SDL2_LIBRARIES
There's a build failure with msys2/mingw64', due to the use of ${SDL2_LIBRARIES}.
After the call to find_package(SDL2 CONFIG)
in the main CMakeLists, SDL2_LIBRAIRES is set to SDL2::SDL2main;SDL2::SDL2
.
Thus, many targets, such as cli
for instance, are linked with SDL2::SDL2main.
On MSys, SDL2::SDL2main sets a '-Wl,undefined=WinMain' flags. It means that SDL_main() has to be defined.
And so, the targets which do not include SDL2/SDL.h fail to build (that is all of them but gui
).
A working solution (checked with msys/mingw and with Fedora) would be to replace the use of ${SDL2_LIBRARIES} by SDL2::SDL2
Proposed MR !1811 (merged)
Edited by samuel degrande