From 32a6f239cf496a400e66e9e288b792042f84d723 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Mon, 16 Sep 2024 00:06:41 +0200 Subject: [PATCH] cmake: always use pthread outside of MSVC --- cmake/DaemonFlags.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmake/DaemonFlags.cmake b/cmake/DaemonFlags.cmake index 0ddbd16761..70b84a66e7 100644 --- a/cmake/DaemonFlags.cmake +++ b/cmake/DaemonFlags.cmake @@ -304,10 +304,9 @@ else() endif() # The -pthread flag sets some preprocessor defines, - # it is also used to link with libpthread on Linux. - if (NOT APPLE) - try_c_cxx_flag(PTHREAD "-pthread") - endif() + # it is also used to link with libpthread. + try_c_cxx_flag(PTHREAD "-pthread") + try_linker_flag(LINKER_PTHREAD "-pthread") if (USE_ADDRESS_SANITIZER) set_cxx_flag("-fsanitize=address")