Somewhere on the disk not in the project of Android Studio is a ready-made C ++ - library in source code with ready CMakeLists.txt. I would not like to touch this library (copy / move to the project or change it) and I would like to use this ready CMakeLists.txt.

Android Studio allows you to select CMakeLists.txt and build a library without problems. But by itself, this library in Android Java-project is useless, you need to do JNI-binding. So you need to write a second CMakeLists.txt, which will build a dynamic library, to which the first library should be linked.

The question is, how is all this done? Do I need to distribute these libraries on separate modules? Or you can somehow call the assembly via CMake twice from one module and indicate to the second that you need to use the results of the first? Which way to pass to target_link_libraries ()?

And if you make separate modules, then in theory a static library will fall into the aar archive and will not be able to use it from another module?

In other words, how in Android Studio in the Gradle + CMake bundle one native library is linked to another, if both libraries are given in the source code and have their own independent CMakeLists.txt?

    0