Skip to content

Commit

Permalink
Merge pull request #82 from r-value/master
Browse files Browse the repository at this point in the history
Prefer `-pthread` flag for pthread
  • Loading branch information
jpcima authored Nov 26, 2021
2 parents 041935e + 8ee4966 commit a17a34a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmake/LinkHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ macro(target_link_static_threads TARGET)
# use a statically link winpthread
target_link_libraries("${TARGET}" PRIVATE "-Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive,-Bdynamic")
else()
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
target_link_libraries("${TARGET}" PRIVATE ${CMAKE_THREAD_LIBS_INIT})
endif()
Expand Down

0 comments on commit a17a34a

Please sign in to comment.