How use SDL2 Android static lib

Hi,
I have an android project working using libSDL2.so generated using “ndk-build”.
I load libGame.so, the library generated by “ndk-build” where my Main.cpp is.
All works fine but I would use libSDL2.a (for each arch).
How use ndk-build to build them ?
Will they be compiled inside “libs” folder for each arch ?
Thanks for the help

ok I finally got it working, a bug in Android.mk for SDL2_Static is there, here the fix :

Code:
LOCAL_SRC_FILES += $(LOCAL_PATH)/src/main/android/SDL_android_main.c

has to be changed to :

Code:
LOCAL_SRC_FILES += $(subst $(LOCAL_PATH)/,$(LOCAL_PATH)/src/main/android/SDL_android_main.c)

There is no way to prebuilt each SDL2 .a files for each arch and use them in the android project to avoid to add the SDL2 sources in jni folder ?

I have a branch that builds NDK_MODULE conformant binaries via CMake.
(Once it is built, you don’t actually need CMake.) It can build both
dynamic and static libraries which are standalone and redeployable so
you don’t have to embed SDL in every project. I’m using this as a
foundation piece in a new SDK that I hope to ship ‘real soon’. I hope
to get this mainlined someday, but it didn’t make the cut for 2.0.4
and I’ve been busy otherwise.

My original topic post was here:
https://forums.libsdl.org/viewtopic.php?t=10263&sid=2888ecbb7fc048bbb49de54e0c357dda

You can find my latest branch here:

-EricOn 6/7/15, Alundra <segura.mikael at orange.fr> wrote:

There is no way to prebuilt each SDL2 .a files for each arch and use them in
the android project to avoid to add the SDL2 sources in jni folder ?


Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

Ok yea, you added the classical android toolchain for cmake and use it, this is what I wanted to do but the best should SDL2 to have that directly to avoid extra work.
One .bat can be added for windows and linux to call it to generate all arch once.

Well, once you have the toolchain and CMake, it is just a single
script call to have SDL generate everything.

Right now the most annoying part is generating the NDK standalone
toolchain. For Linux/Mac, it is annoying, but pretty easy. Windows is
huge pain though. If the CMake toolchain was improved to not require
the NDK standalone toolchain, it would be a snap. I think this is
possible, but last time I tried, I got overwhelmed and had to sideline
it. (The toolchain changes I made were more meticulous than usual
because I was validating all the compiler flags for each architecture
to make sure they were the same as normal Android, and if not, were
they good/legitimate changes. I’ve seen flag changes behave badly
before.)

-EricOn 6/8/15, Alundra <segura.mikael at orange.fr> wrote:

Ok yea, you added the classical android toolchain for cmake and use it, this
is what I wanted to do but the best should SDL2 to have that directly to
avoid extra work.
One .bat can be added for windows and linux to call it to generate all arch
once.


Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/