From bd2dbe76129734584e82e447e521cbe9c02b2b8e Mon Sep 17 00:00:00 2001 From: leleliu008 Date: Mon, 15 Nov 2021 22:15:06 +0800 Subject: [PATCH] add check libpthread if can be found, once found it, link it, otherwise do not link it. Beacause on Android, unlike Linux, there are no separate libpthread libraries. That functionality is included directly in libc --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9ef9c05..9c69521e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,10 @@ if(LUAU_BUILD_CLI) target_link_libraries(Luau.Repl.CLI PRIVATE Luau.Compiler Luau.VM) if(UNIX) - target_link_libraries(Luau.Repl.CLI PRIVATE pthread) + find_library(LIBPTHREAD pthread) + if (LIBPTHREAD) + target_link_libraries(Luau.Repl.CLI PRIVATE pthread) + endif() endif() if(NOT EMSCRIPTEN)