mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:13:34 +03:00
cmake: use Threads::Threads imported target for POSIX Threads
- use `Threads::Threads` imported target, replacing `CMAKE_THREAD_LIBS_INIT`. To use the modern form and to allow using `THREADS_PREFER_PTHREAD_FLAG` option. - only add Threads library/options if POSIX Threads was detected (not any other threading backend FindThreads may detect, e.g. the HP one.) - curl-config.in.cmake: detect and define `Threads::Threads`. Refs: https://cmake.org/cmake/help/v3.18/module/FindThreads.html https://cmake.org/cmake/help/v4.3/module/FindThreads.html Closes #21163
This commit is contained in:
parent
ce6c441cf2
commit
2d546d239e
2 changed files with 9 additions and 2 deletions
|
|
@ -35,6 +35,10 @@ endif()
|
|||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
if("@HAVE_THREADS_POSIX@")
|
||||
find_dependency(Threads) # for Threads::Threads
|
||||
endif()
|
||||
|
||||
if("@USE_OPENSSL@")
|
||||
if("@OPENSSL_VERSION_MAJOR@")
|
||||
find_dependency(OpenSSL "@OPENSSL_VERSION_MAJOR@")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue