Saturday, 19 February 2022

How do I create a cmakelist file which builds libraries that are automatically placed in jniLibs folder?

Say you have a collection of source files:

s1.c
s2.c
s3.c
s4.c
s5.c
s6.c

prebuilt shared libraries:

sh1.so
sh2.so
sh3.so

and prebuilt static libraries:

st1.a
st2.a
st3.a

The task is to create a cmakelist file which does the following:

  1. Builds a shared library called app.so which is loaded using System.LoadLibrary when the application is run

  2. Builds a shared library called app_sh1.so which is automatically placed in src/main/jniLibs after being built

  3. Builds a shared library called app_sh2.so which is automatically placed in src/main/jniLibs after being built

  4. app.so is composed of s1.c, s2.c sh1.so and st1.a

  5. app_sh1.so is composed of s3.c, s4.c, sh2.so and st2.a

  6. app_sh2.so is composed of s5.c, s6.c, sh3.so and st3.a

How do I accomplish this?



from How do I create a cmakelist file which builds libraries that are automatically placed in jniLibs folder?

No comments:

Post a Comment