From ba095ea3ea7da659a7a157a0717c454008867875 Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Tue, 15 Oct 2024 08:44:14 +0200 Subject: Fix CMake build on FreeBSD FreeBSD's libc has a stub implementation of pthread_once() that returns ENOSYS and doesn't seem to call the init routine. You need to link with pthread for this to work. This PR does this and fixes regress failures for CMake builds on this platform. This likely never worked. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c3d0d4..204cb1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) endif() +if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) +endif() + if(WIN32) set(BUILD_NC false) if(MINGW) -- cgit v1.2.3-55-g6feb