Commit 5e317b19 by 明月惊鹊 Committed by GitHub

API目录支持安卓编译,输出libmk_api.a (#1854)

* API目录支持安卓编译,输出libmk_api.a

* API目录支持安卓编译,输出libmk_api.a[参考 wasphin大佬的指导改进了一些地方]

* update ndk version

Co-authored-by: 夏楚 <771730766@qq.com>
parent ec3fe435
...@@ -2,7 +2,7 @@ apply plugin: 'com.android.application' ...@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion 28 compileSdkVersion 28
ndkVersion "21.4.7075529" ndkVersion "25.0.8775105"
defaultConfig { defaultConfig {
applicationId "com.zlmediakit.demo" applicationId "com.zlmediakit.demo"
minSdkVersion 15 minSdkVersion 15
...@@ -14,7 +14,7 @@ android { ...@@ -14,7 +14,7 @@ android {
externalNativeBuild { externalNativeBuild {
cmake { cmake {
cppFlags "-std=c++11 -frtti -fexceptions" cppFlags "-std=c++11 -frtti -fexceptions"
arguments "-DENABLE_API=off", "-DENABLE_TESTS=off", "-DENABLE_PLAYER=off", "-DENABLE_SERVER_LIB=on" arguments "-DENABLE_API=on", "-DENABLE_API_STATIC_LIB=on", "-DENABLE_TESTS=off", "-DENABLE_PLAYER=off", "-DENABLE_SERVER_LIB=on"
} }
} }
ndk { ndk {
......
...@@ -58,6 +58,9 @@ target_include_directories(mk_api ...@@ -58,6 +58,9 @@ target_include_directories(mk_api
if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(mk_api -Wl,--start-group ${LINK_LIBRARIES} -Wl,--end-group) target_link_libraries(mk_api -Wl,--start-group ${LINK_LIBRARIES} -Wl,--end-group)
elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
include_directories("${CMAKE_BINARY_DIR}")
target_link_libraries(mk_api log -Wl,--start-group ${LINK_LIBRARIES} -Wl,--end-group)
else() else()
target_link_libraries(mk_api jsoncpp ${LINK_LIBRARIES}) target_link_libraries(mk_api jsoncpp ${LINK_LIBRARIES})
endif() endif()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论