I have an Android Studio project (2.3) with 2 modules using CMake for native code.
Project
What is the preferred way to bundle libnative.so(assembly using Module2) into a JNI wrapper in Module1? I am currently using ...
Module1-CMakeLists.txt:
add_library( native SHARED IMPORTED )
set_target_properties( jniwrapper PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../libnative/build/intermediates/cmake/${BUILD_TYPE}/obj/${ANDROID_ABI}/libnative.so )
... where it is BUILD_TYPEinstalled in Module1 build.gradle, depending on the type of assembly.
This works if I use "Make Module 'Module2'" in AS before building the complete project. However, it seems that it is rather difficult to extract the library from the hierarchy of the gradle build folders.
, Module2 CMakeLists.txt lib- Module1 . CMake, , install.
( , .)
!