Skip to content

Commit

Permalink
Add pthreads back into CMake for htslib linking
Browse files Browse the repository at this point in the history
  • Loading branch information
lczech committed Feb 28, 2024
1 parent 0e0024e commit db905eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ if(GENESIS_USE_HTSLIB)
SET( GENESIS_HTSLIB_VERSION "1.16" ) #GENESIS_HTSLIB_VERSION#

# Included from modules dir tools/cmake
# htslib needs pthreads to be linked, so we include this here as well
include( IncludePthreads )
include( IncludeHtslib )

endif()
Expand Down Expand Up @@ -468,6 +470,9 @@ IF( GENESIS_HAS_PARENT_DIR )
if(ZLIB_FOUND)
set( ZLIB_FOUND ${ZLIB_FOUND} PARENT_SCOPE )
endif()
if(THREADS_FOUND)
set( THREADS_FOUND ${THREADS_FOUND} PARENT_SCOPE )
endif()
if(OPENMP_FOUND)
set( OPENMP_FOUND ${OPENMP_FOUND} PARENT_SCOPE )
endif()
Expand Down
7 changes: 4 additions & 3 deletions tools/cmake/IncludePthreads.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
# Use PThreads
# ------------------------------------------------------------------------------

# This file can be included from the main CMakeLists.txt in order to figure out
# This file is included from the main CMakeLists.txt in order to figure out
# if Pthreads are available, and if so, set its paths and flags.
# We curently do not use this any more, as we have switched to just using
# the plain C++11 threading model instead. We keep this here for reference only.
# We curently do not use pthreads internally any more, as we have switched to just using
# the plain C++11 threading model instead. However, they seem to be needed for properly
# linking htslib... So we have to keep this around.

message (STATUS "Looking for Threads")
set (CMAKE_THREAD_PREFER_PTHREAD ON)
Expand Down

0 comments on commit db905eb

Please sign in to comment.