diff options
| author | Raphael Kubo da Costa <rakuco@FreeBSD.org> | 2014-02-03 12:58:37 +0200 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2014-02-03 14:38:39 +0100 |
| commit | 4e04ec8bf57bdb27ceb84867e04105b2820d3e1f (patch) | |
| tree | 87b26a85f751edc7ab90a0a6d0bd0120418281c8 /src | |
| parent | 79a80cdc77a6a437723fc91373dfbcc972306035 (diff) | |
| download | libssh-4e04ec8bf57bdb27ceb84867e04105b2820d3e1f.tar.gz libssh-4e04ec8bf57bdb27ceb84867e04105b2820d3e1f.tar.xz libssh-4e04ec8bf57bdb27ceb84867e04105b2820d3e1f.zip | |
threads: Be less strict when deciding whether to build libssh_threads.
As mentioned in the previous commit, there are cases where
CMAKE_HAVE_THREADS_LIBRARY is not set and pthreads _is_ being used: one can
pass -DTHREADS_HAVE_PTHREAD_ARG=1 to CMake directly so that it just passes
-pthread to the compiler/linker and does not set CMAKE_HAVE_THREADS_LIBRARY.
Since we are only interested in knowing whether any threading library has
been found, we should use CMAKE_THREAD_LIBS_INIT instead (Threads_FOUND
would also work).
Note that, at the moment, there is only a pthreads backend available in
threads/, so if it is not found configuration will fail because CMake will
try to create a library from an empty set of source files.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 83435d0c..fa8c5c25 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -288,6 +288,6 @@ if (WITH_STATIC_LIB) ) endif (WITH_STATIC_LIB) -if (CMAKE_HAVE_THREADS_LIBRARY) +if (CMAKE_THREAD_LIBS_INIT) add_subdirectory(threads) -endif (CMAKE_HAVE_THREADS_LIBRARY) +endif (CMAKE_THREAD_LIBS_INIT) |
