diff --git a/Android/app/build.gradle b/Android/app/build.gradle index 5bf67f9f..4764f8ce 100644 --- a/Android/app/build.gradle +++ b/Android/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 28 - ndkVersion "21.4.7075529" + ndkVersion "25.0.8775105" defaultConfig { applicationId "com.zlmediakit.demo" minSdkVersion 15 @@ -14,7 +14,7 @@ android { externalNativeBuild { cmake { 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 { diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt index e7441de1..227c07cd 100644 --- a/api/CMakeLists.txt +++ b/api/CMakeLists.txt @@ -58,6 +58,9 @@ target_include_directories(mk_api if(CMAKE_SYSTEM_NAME MATCHES "Linux") 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() target_link_libraries(mk_api jsoncpp ${LINK_LIBRARIES}) endif()