Skip to content

Commit

Permalink
Fix CMake build on FreeBSD
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
botovq committed Oct 15, 2024
1 parent 3f90032 commit 91658ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 91658ff

Please sign in to comment.