mirror of
https://github.com/curl/curl.git
synced 2025-04-18 16:30:45 +08:00
cmake: speed up threads setup for Windows
Win32 threads are always available. We enabled them unconditionally (with `ENABLE_THREADED_RESOLVER`). CMake built-in thread detection logic has this condition hard-coded for Windows as well (since at least 2007). Instead of doing all the work of detecting pthread combinations on Windows, then discarding those results, skip these efforts and assume built-in thread support when building for Windows. This saves 1-3 slow CMake configuration steps. Reviewed-by: Daniel Stenberg Closes #12202
This commit is contained in:
parent
c5d506e9bb
commit
191e695fe4
@ -369,14 +369,14 @@ if(WIN32)
|
||||
endif()
|
||||
|
||||
if(ENABLE_THREADED_RESOLVER)
|
||||
find_package(Threads REQUIRED)
|
||||
if(WIN32)
|
||||
set(USE_THREADS_WIN32 ON)
|
||||
else()
|
||||
find_package(Threads REQUIRED)
|
||||
set(USE_THREADS_POSIX ${CMAKE_USE_PTHREADS_INIT})
|
||||
set(HAVE_PTHREAD_H ${CMAKE_USE_PTHREADS_INIT})
|
||||
set(CURL_LIBS ${CURL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
set(CURL_LIBS ${CURL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
# Check for all needed libraries
|
||||
|
Loading…
x
Reference in New Issue
Block a user