aboutsummaryrefslogtreecommitdiff
path: root/ports/mosquitto/support-static-build.patch
blob: 28d7d779aacb14b98046a8b29b690fe9b3b2a473 (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
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index bd60b75..cc01a2a 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -60,7 +60,7 @@ if (UNIX AND NOT APPLE)
 endif (UNIX AND NOT APPLE)
 
 if (WIN32)
-	set (LIBRARIES ${LIBRARIES} ws2_32)
+	set (LIBRARIES ${LIBRARIES} ws2_32 crypt32)
 endif (WIN32)
 
 if (WITH_SRV)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7898ff5..23b3fe8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -158,7 +158,7 @@ if (UNIX)
 endif (UNIX)
 
 if (WIN32)
-	set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32)
+	set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32 crypt32)
 endif (WIN32)
 
 if (WITH_WEBSOCKETS)
@@ -189,6 +189,10 @@ install(FILES mosquitto_broker.h mosquitto_plugin.h DESTINATION "${CMAKE_INSTALL
 
 if (WITH_TLS)
 	add_executable(mosquitto_passwd mosquitto_passwd.c)
-	target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES})
+    if(WIN32)
+        target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES} ws2_32 crypt32)
+    else()
+        target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES})
+    endif()
 	install(TARGETS mosquitto_passwd RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
 endif (WITH_TLS)