Merge pull request #150 from eliteraspberries/android

build: The pthread library is part of libc on Android.
This commit is contained in:
Joni Räsänen 2022-07-20 13:53:42 +03:00 committed by GitHub
commit 5ae94f338d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -158,7 +158,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")