diff options
author | Theo Buehler <tb@openbsd.org> | 2024-10-15 08:44:14 +0200 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2024-10-16 03:04:00 -0500 |
commit | ba095ea3ea7da659a7a157a0717c454008867875 (patch) | |
tree | 45096ca6a6fcb966248b5311ef7b9c349590fd7e | |
parent | 33c5cbfb4b4fa06ff75b2920db5bb27272115e41 (diff) | |
download | portable-ba095ea3ea7da659a7a157a0717c454008867875.tar.gz portable-ba095ea3ea7da659a7a157a0717c454008867875.tar.bz2 portable-ba095ea3ea7da659a7a157a0717c454008867875.zip |
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.
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
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") | |||
89 | set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) | 89 | set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) |
90 | endif() | 90 | endif() |
91 | 91 | ||
92 | if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") | ||
93 | set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) | ||
94 | endif() | ||
95 | |||
92 | if(WIN32) | 96 | if(WIN32) |
93 | set(BUILD_NC false) | 97 | set(BUILD_NC false) |
94 | if(MINGW) | 98 | if(MINGW) |