Skip to content

Commit

Permalink
Merge pull request #3862 from likema/fix-hpux-parisc
Browse files Browse the repository at this point in the history
Fix building on HP-UX 11.11 PA-RISC
  • Loading branch information
Cyan4973 authored Mar 11, 2024
2 parents 372fddf + e49d1ab commit a4db145
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions build/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,20 @@ endif ()
# External dependencies
#-----------------------------------------------------------------------------
if (ZSTD_MULTITHREAD_SUPPORT AND UNIX)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
if(CMAKE_USE_PTHREADS_INIT)
if (CMAKE_SYSTEM_NAME MATCHES "HP-UX")
find_package(Threads)
if (NOT Threads_FOUND)
set(CMAKE_USE_PTHREADS_INIT 1)
set(CMAKE_THREAD_LIBS_INIT -lpthread)
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(Threads_FOUND TRUE)
endif ()
else ()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
endif ()

if (CMAKE_USE_PTHREADS_INIT)
set(THREADS_LIBS "${CMAKE_THREAD_LIBS_INIT}")
else()
message(SEND_ERROR "ZSTD currently does not support thread libraries other than pthreads")
Expand Down

0 comments on commit a4db145

Please sign in to comment.