summaryrefslogtreecommitdiffstats
path: root/main/libssh/link-pthread.patch
blob: 2e2c770f6ad057f9764674e6f4c57d9b708fb4ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index aeff201..0191d5d 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -13,36 +13,36 @@ include_directories(
 
 if (LINUX)
     add_executable(libssh_scp libssh_scp.c ${examples_SRCS})
-    target_link_libraries(libssh_scp ${LIBSSH_SHARED_LIBRARY})
+    target_link_libraries(libssh_scp ${LIBSSH_SHARED_LIBRARY} pthread)
 
     add_executable(scp_download scp_download.c ${examples_SRCS})
-    target_link_libraries(scp_download ${LIBSSH_SHARED_LIBRARY})
+    target_link_libraries(scp_download ${LIBSSH_SHARED_LIBRARY} pthread)
 
     add_executable(samplessh sample.c ${examples_SRCS})
-    target_link_libraries(samplessh ${LIBSSH_SHARED_LIBRARY})
+    target_link_libraries(samplessh ${LIBSSH_SHARED_LIBRARY} pthread)
 
     add_executable(sshnetcat sshnetcat.c ${examples_SRCS})
-    target_link_libraries(sshnetcat ${LIBSSH_SHARED_LIBRARY})
+    target_link_libraries(sshnetcat ${LIBSSH_SHARED_LIBRARY} pthread)
 
     if (WITH_SFTP)
         add_executable(samplesftp samplesftp.c ${examples_SRCS})
-        target_link_libraries(samplesftp ${LIBSSH_SHARED_LIBRARY})
+        target_link_libraries(samplesftp ${LIBSSH_SHARED_LIBRARY} pthread)
     endif (WITH_SFTP)
 
     if (WITH_SERVER)
         add_executable(samplesshd samplesshd.c)
-        target_link_libraries(samplesshd ${LIBSSH_SHARED_LIBRARY})
+        target_link_libraries(samplesshd ${LIBSSH_SHARED_LIBRARY} pthread)
     endif (WITH_SERVER)
 endif (LINUX)
 
 add_executable(exec exec.c ${examples_SRCS})
-target_link_libraries(exec ${LIBSSH_SHARED_LIBRARY})
+target_link_libraries(exec ${LIBSSH_SHARED_LIBRARY} pthread)
 
 add_executable(senddata senddata.c ${examples_SRCS})
-target_link_libraries(senddata ${LIBSSH_SHARED_LIBRARY})
+target_link_libraries(senddata ${LIBSSH_SHARED_LIBRARY} pthread)
 
 add_executable(libsshpp libsshpp.cpp)
-target_link_libraries(libsshpp ${LIBSSH_SHARED_LIBRARY})
+target_link_libraries(libsshpp ${LIBSSH_SHARED_LIBRARY} pthread)
 
 add_executable(libsshpp_noexcept libsshpp_noexcept.cpp)
-target_link_libraries(libsshpp_noexcept ${LIBSSH_SHARED_LIBRARY})
+target_link_libraries(libsshpp_noexcept ${LIBSSH_SHARED_LIBRARY} pthread)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e158665..ef2005d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -40,6 +40,7 @@ if (HAVE_LIBSOCKET)
   set(LIBSSH_LINK_LIBRARIES
     ${LIBSSH_LINK_LIBRARIES}
     socket
+    pthread
   )
 endif (HAVE_LIBSOCKET)