Skip to content

Commit a4db145

Browse files
authored
Merge pull request #3862 from likema/fix-hpux-parisc
Fix building on HP-UX 11.11 PA-RISC
2 parents 372fddf + e49d1ab commit a4db145

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

build/cmake/CMakeLists.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,20 @@ endif ()
115115
# External dependencies
116116
#-----------------------------------------------------------------------------
117117
if (ZSTD_MULTITHREAD_SUPPORT AND UNIX)
118-
set(THREADS_PREFER_PTHREAD_FLAG ON)
119-
find_package(Threads REQUIRED)
120-
if(CMAKE_USE_PTHREADS_INIT)
118+
if (CMAKE_SYSTEM_NAME MATCHES "HP-UX")
119+
find_package(Threads)
120+
if (NOT Threads_FOUND)
121+
set(CMAKE_USE_PTHREADS_INIT 1)
122+
set(CMAKE_THREAD_LIBS_INIT -lpthread)
123+
set(CMAKE_HAVE_THREADS_LIBRARY 1)
124+
set(Threads_FOUND TRUE)
125+
endif ()
126+
else ()
127+
set(THREADS_PREFER_PTHREAD_FLAG ON)
128+
find_package(Threads REQUIRED)
129+
endif ()
130+
131+
if (CMAKE_USE_PTHREADS_INIT)
121132
set(THREADS_LIBS "${CMAKE_THREAD_LIBS_INIT}")
122133
else()
123134
message(SEND_ERROR "ZSTD currently does not support thread libraries other than pthreads")

0 commit comments

Comments
 (0)