SDL2 + CMake + Android (on Windows)

Maybe I haven’t really thought this though, but if I was starting from scratch I’d maybe dump the whole separate SDL_main library and do something a lot of header only libraries do: basically the user would define something before including sdl in EXACTLY one source file and the include would add the appropriate entry point code there. So on windows a WinMain would be inserted to that file and on android a jni callback and so on.

Usage would be something like:

#define SDL_ENTRY_POINT
#include <SDL.h>

int SDL_Main(int argc, char **argv) {
    return 0;
}

I’d also probably drop abusing int main(int argc, char **argv) because the redefinition seems to just add confusion and I don’t really see the benefit in it.

Now that I think of it, this kind of system would probably be possible to add in addition to the current stuff. So you would just not link to SDL_main if you defined the entry point already like above.