vcpkg/ports/x265/pthread.diff
Kai Pastor c6043cde21
[x265] Update to 3.6, fix pthread flags, add feature "tools" (#39450)
Fixes build errors on android due to wrong pthread flags and 32 bit API
level requirements (`ftello`).

Alternative to #39314.
2024-06-24 18:03:17 -07:00

25 lines
819 B
Diff

diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index a407271..f147d37 100755
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -85,6 +85,9 @@ else()
endif()
if(UNIX)
+ set(THREADS_PREFER_PTHREAD_FLAG 1)
+ find_package(Threads)
+ add_library(pthread ALIAS Threads::Threads)
list(APPEND PLATFORM_LIBS pthread)
find_library(LIBRT rt)
if(LIBRT)
@@ -705,6 +708,9 @@ if(X265_LATEST_TAG)
list(REMOVE_ITEM PLIBLIST "-lc" "-lpthread" "-lmingwex" "-lmingwthrd"
"-lmingw32" "-lmoldname" "-lmsvcrt" "-ladvapi32" "-lshell32"
"-luser32" "-lkernel32")
+ if(UNIX)
+ list(APPEND PLIBLIST ${CMAKE_THREAD_LIBS_INIT})
+ endif()
string(REPLACE ";" " " PRIVATE_LIBS "${PLIBLIST}")
else()
set(PRIVATE_LIBS "")