mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-11 15:19:03 +08:00
c6043cde21
Fixes build errors on android due to wrong pthread flags and 32 bit API level requirements (`ftello`). Alternative to #39314.
25 lines
819 B
Diff
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 "")
|