summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaphael Kubo da Costa <rakuco@FreeBSD.org>2014-02-06 12:08:57 +0200
committerAndreas Schneider <asn@cryptomilk.org>2014-02-06 11:12:50 +0100
commit398e8d50b54c6947b9c6e494fc6adc17e96521be (patch)
treeffea1f14aacd5430d64277ef6b08c0b905cda46f /src
parentfa34d117495a9140fdeea78ac0ba66eeb35e6cac (diff)
downloadlibssh-398e8d50b54c6947b9c6e494fc6adc17e96521be.tar.gz
libssh-398e8d50b54c6947b9c6e494fc6adc17e96521be.tar.xz
libssh-398e8d50b54c6947b9c6e494fc6adc17e96521be.zip
build: Use Threads_FOUND to decide whether to build ssh_threads.
Follow-up to 4e04ec8, which caused a regression on OS X. Checking the value of CMAKE_THREAD_LIBS_INIT to decide whether any threading library is present on a system turns out to be wrong -- in OS X, for example, usage of pthreads does not depend on any additional linker or compiler flags, so CMAKE_THREAD_LIBS_INIT is empty and our check in src/CMakeLists.txt failed (it used to work before 4e04ec8 because CMAKE_HAVE_THREADS_LIBRARY is set). Instead, just look for Threads_FOUND, which FindThreads sets just like any other Find module when it has found what it was looking for. Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fa8c5c25..1891a00a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -288,6 +288,6 @@ if (WITH_STATIC_LIB)
)
endif (WITH_STATIC_LIB)
-if (CMAKE_THREAD_LIBS_INIT)
+if (Threads_FOUND)
add_subdirectory(threads)
-endif (CMAKE_THREAD_LIBS_INIT)
+endif (Threads_FOUND)