Skip to content

Commit ba095ea

Browse files
botovqbusterb
authored andcommitted
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.
1 parent 33c5cbf commit ba095ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
8989
set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread)
9090
endif()
9191

92+
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
93+
set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread)
94+
endif()
95+
9296
if(WIN32)
9397
set(BUILD_NC false)
9498
if(MINGW)

0 commit comments

Comments
 (0)