Fixed bug 2812 - Make libSDL2main.a usable on Android via a dummy symbol

Jonas Kulla

This eliminates the need to manually compile in SDL_main_android.c.
Instead, add "-lSDL2main -Wl,-u,SDL_main_dummy" when linking.

I don't know how the nkd-build process works, but unless it was
for some reason linking libSDL2main.a it should be unaffected.
This commit is contained in:
Sam Lantinga
2017-08-13 18:12:06 -07:00
parent e977225937
commit df2d299447
3 changed files with 7 additions and 0 deletions

View File

@@ -15,6 +15,9 @@
*******************************************************************************/
#include <jni.h>
/* Dummy symbol so '-u SDL_main_dummy' forces ld to link in libSDL2main.a */
JNIEXPORT int SDL_main_dummy;
/* Called before SDL_main() to initialize JNI bindings in SDL library */
extern void SDL_Android_Init(JNIEnv* env, jclass cls);