1
0
mirror of git://f0xx.org/android_cast synced 2026-07-29 06:39:09 +03:00
This commit is contained in:
Anton Afanasyeu
2026-05-18 15:55:02 +02:00
parent f547770288
commit f7e200fa94
121 changed files with 140 additions and 10838 deletions

View File

@@ -4,6 +4,7 @@ project(androidcast_codecs C)
set(CMAKE_C_STANDARD 11)
set(THIRD_PARTY_ROOT ${CMAKE_SOURCE_DIR}/../third-party)
set(NATIVE_LIBS_ROOT ${CMAKE_SOURCE_DIR}/../build/native)
set(NDK_BRIDGE ${CMAKE_SOURCE_DIR})
add_library(androidcast_codecs SHARED
@@ -17,15 +18,31 @@ target_include_directories(androidcast_codecs PRIVATE
${NDK_BRIDGE}/jni
)
if(DEFINED ENV{ANDROIDCAST_LIBVPX_LIB} AND EXISTS "$ENV{ANDROIDCAST_LIBVPX_LIB}")
message(STATUS "Linking libvpx from $ENV{ANDROIDCAST_LIBVPX_LIB}")
# Per-ABI libvpx.a from scripts/build-native-codecs.sh (do not link arm64 into armeabi-v7a).
set(LIBVPX_LIB "")
if(ANDROID_ABI)
set(LIBVPX_PER_ABI "${NATIVE_LIBS_ROOT}/${ANDROID_ABI}/libvpx.a")
if(EXISTS "${LIBVPX_PER_ABI}")
set(LIBVPX_LIB "${LIBVPX_PER_ABI}")
endif()
endif()
if(NOT LIBVPX_LIB AND DEFINED ENV{ANDROIDCAST_LIBVPX_LIB})
string(FIND "$ENV{ANDROIDCAST_LIBVPX_LIB}" "${ANDROID_ABI}" _abi_match)
if(_abi_match GREATER -1 AND EXISTS "$ENV{ANDROIDCAST_LIBVPX_LIB}")
set(LIBVPX_LIB "$ENV{ANDROIDCAST_LIBVPX_LIB}")
endif()
endif()
if(LIBVPX_LIB)
message(STATUS "Linking libvpx for ${ANDROID_ABI}: ${LIBVPX_LIB}")
target_compile_definitions(androidcast_codecs PRIVATE ANDROIDCAST_HAVE_LIBVPX=1)
target_link_libraries(androidcast_codecs "$ENV{ANDROIDCAST_LIBVPX_LIB}")
target_link_libraries(androidcast_codecs "${LIBVPX_LIB}")
if(EXISTS "${THIRD_PARTY_ROOT}/libvpx")
target_include_directories(androidcast_codecs PRIVATE "${THIRD_PARTY_ROOT}/libvpx")
target_include_directories(androidcast_codecs PRIVATE "${THIRD_PARTY_ROOT}/libvpx/vpx")
endif()
elseif(EXISTS "${THIRD_PARTY_ROOT}/libvpx")
message(STATUS "libvpx submodule present — set ANDROIDCAST_LIBVPX_LIB to link (see ndk/README.md)")
else()
message(STATUS "No libvpx.a for ${ANDROID_ABI} — VPx JNI probe off (build with scripts/build-native-codecs.sh ${ANDROID_ABI})")
endif()
find_library(log-lib log)