build: The pthread library is part of libc on Android.

This commit is contained in:
Mansour Moufid 2022-07-19 14:19:00 -04:00
parent 4f9bd185ce
commit b87bd7e489
1 changed files with 4 additions and 1 deletions

View File

@ -156,7 +156,10 @@ if (UNIX)
# Try finding if pkg-config installed in the system
find_package(PkgConfig REQUIRED)
if(PkgConfig_FOUND)
list(APPEND UVGRTP_LINKER_FLAGS "-luvgrtp" "-lpthread")
list(APPEND UVGRTP_LINKER_FLAGS "-luvgrtp")
if(CMAKE_USE_PTHREADS_INIT AND NOT CMAKE_HAVE_LIBC_PTHREAD)
list(APPEND UVGRTP_LINKER_FLAGS "-lpthread")
endif()
# Check PKG_CONFIG_PATH, if not defined, use /usr/local/lib/pkgconfig
if(NOT DEFINED ENV{PKG_CONFIG_PATH})
set(PKG_CONFIG_PATH "/usr/local/lib/pkgconfig")