I generated a static library from macos terminal with `ar rcs libws.a libws.o`
I have tested it with my own test program and everything works fine.
Now I would like to include the static library in android, but I have a build time error.
This is my cmake file
cmake_minimum_required(VERSION 3.10.2)
add_library(
libws
STATIC
IMPORTED)
set_target_properties(libws
PROPERTIES
IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../jniLibs/libws/libws.a)
add_library(
native-lib
SHARED
native-lib.cpp
)
target_include_directories(native-lib PRIVATE
${CMAKE_SOURCE_DIR}/../jniLibs/libws/include
logger )
#include_directories(src/main/cpp/)
find_library(
log-lib
log)
target_link_libraries(
native-lib
libws
${log-lib})
This is the build error
/src/main/cpp/../jniLibs/libws/libws.a -llog -latomic -lm -Bstatic -lc++ -Bdynamic -lm -lgcc -ldl -lc -lgcc -ldl /Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/23/crtend_so.o
/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: src/main/cpp/../jniLibs/libws/libws.a: no archive symbol table (run ranlib)
Any help?