mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-05 20:55:46 +03:00
build: Fixed pthread detection.
This commit is contained in:
@@ -62,8 +62,10 @@ else (WITH_GCRYPT)
|
||||
endif (NOT OPENSSL_FOUND)
|
||||
endif(WITH_GCRYPT)
|
||||
|
||||
#find out if we have threading available
|
||||
include(FindThreads)
|
||||
# Find out if we have threading available
|
||||
set(CMAKE_THREAD_PREFER_PTHREADS ON)
|
||||
find_package(Threads)
|
||||
|
||||
# config.h checks
|
||||
include(ConfigureChecks.cmake)
|
||||
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
@@ -58,10 +58,8 @@ check_include_file(openssl/blowfish.h HAVE_OPENSSL_BLOWFISH_H)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIRS})
|
||||
check_include_file(openssl/des.h HAVE_OPENSSL_DES_H)
|
||||
|
||||
include(FindThreads)
|
||||
|
||||
if (CMAKE_HAVE_PTHREAD_H)
|
||||
set(HAVE_PTHREAD_H)
|
||||
set(HAVE_PTHREAD_H 1)
|
||||
endif (CMAKE_HAVE_PTHREAD_H)
|
||||
|
||||
# FUNCTIONS
|
||||
@@ -111,6 +109,12 @@ if (Z_LIBRARY)
|
||||
set(HAVE_LIBZ 1)
|
||||
endif (Z_LIBRARY)
|
||||
|
||||
if (CMAKE_HAVE_THREADS_LIBRARY)
|
||||
set(HAVE_PTHREAD 1)
|
||||
|
||||
set(LIBSSH_REQUIRED_LIBRARIES ${LIBSSH_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif (CMAKE_HAVE_THREADS_LIBRARY)
|
||||
|
||||
# OPTIONS
|
||||
if (WITH_DEBUG_CRYPTO)
|
||||
set(DEBUG_CRYPTO 1)
|
||||
@@ -120,10 +124,6 @@ if (WITH_DEBUG_CALLTRACE)
|
||||
set(DEBUG_CALLTRACE 1)
|
||||
endif (WITH_DEBUG_CALLTRACE)
|
||||
|
||||
if (CMAKE_HAVE_PTHREAD_CREATE)
|
||||
set(HAVE_PTHREAD)
|
||||
endif (CMAKE_HAVE_PTHREAD_CREATE)
|
||||
|
||||
# ENDIAN
|
||||
if (NOT WIN32)
|
||||
test_big_endian(WORDS_BIGENDIAN)
|
||||
|
Reference in New Issue
Block a user