I have a c++ file and I want to link it my kotlin app but I dont want to link it .so file. I want to generat .a file and link it to my project. I want to add cpp files on my project because I have not static file. But android studio havenot generated static file. And I got an error. If I build libraries with SHARED parameter, everythings going well.
My CmakeLists file
cmake_minimum_required(VERSION 3.4.1)
add_library(
delaunator-lib
SHARED
delaunator-lib.cpp)
add_library(
delaunator-lib-static
STATIC
delaunator.h)
find_library(
log-lib
log)
target_link_libraries(
delaunator-lib
delaunator-lib-static
${log-lib})
I got a foloowing error while I was tring to build native part of code from gradle externalNativeBuildDebug. If I delete second add_library and add to delaunator.h file to first add library, everythings going well.
CMake Error: CMake can not determine linker language for target: delaunator-lib-static