Android平台下合并patch差分包
一、添加文件
将 bzip2 的所有 .c 和 .h 文件以及bspatch.c 复制到Android Studio 的 cpp 目录下(记得修改main方法名,保证只有一个main入口)
二、在Cmake.txt中链接所有文件
使用
file(GLOB c_path src/main/cpp/*.c)
可以将所有文件添加为一个 c_path 路径变量
file(GLOB c_path src/main/cpp/bzip2/*.c)
add_library( # Sets the name of the library.
bspacth-lib
SHARED
${c_path}
src/main/cpp/bspatch.c)
add_library( # Sets the name of the library.
native-lib
SHARED
src/main/cpp/native-lib.c)
find_library( # Sets the name of the path variable.
log-lib
log)
target_link_libraries( # Specifies the target library.
native-lib
bspac