[mosquitto] Add support for static build (#10636)

* [mosquitto] Add support for static build

* Update ci.baseline.txt

* [libwebsockets] Update options -DLWS_USE_BUNDLED_ZLIB as -DLWS_WITH_BUNDLED_ZLIB
This commit is contained in:
Robert Schumacher 2020-04-16 13:33:10 -07:00 committed by GitHub
commit d216948042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 11 deletions

View File

@ -1,5 +1,5 @@
Source: libwebsockets
Version: 4.0.1
Version: 4.0.1-1
Build-Depends: zlib, openssl, libuv
Homepage: https://github.com/warmcat/libwebsockets
Description: Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources, and provide fast throughput in both directions as client or server.

View File

@ -1,5 +1,5 @@
Source: mosquitto
Version: 1.6.8
Version: 1.6.8-1
Build-Depends: c-ares, libwebsockets, openssl, pthreads
Description: Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1.
MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for "machine to machine" messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino.

View File

@ -1,5 +1,3 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT) # This is a lie. mosquitto can be build staticlly it just must be implemented by vcpkg
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO eclipse/mosquitto
@ -10,6 +8,7 @@ vcpkg_from_github(
archive-dest.patch
win64-cmake.patch
libwebsockets.patch
support-static-build.patch
)
vcpkg_configure_cmake(
@ -43,11 +42,8 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/mosquitto_rr${VCPKG_TARGET_EXECUTABLE_SU
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/mosquitto_sub${VCPKG_TARGET_EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/mosquitto_sub${VCPKG_TARGET_EXECUTABLE_SUFFIX})
#if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
#endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

View File

@ -0,0 +1,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)

View File

@ -1113,7 +1113,6 @@ moos-essential:arm64-windows=fail
moos-essential:x64-windows=fail
moos-essential:x86-windows=fail
moos-essential:x64-linux=ignore
mosquitto:x64-windows-static=fail
mozjpeg:arm64-windows = skip
mozjpeg:arm-uwp = skip
mozjpeg:x64-linux = skip