[paho-mqtt] fix ODR to libuuid and update to 1.3.12 (#30330)

This commit is contained in:
jim wang 2023-04-20 03:10:07 +08:00 committed by GitHub
parent 28dc8b9b2c
commit d1badc3307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 77 additions and 13 deletions

View File

@ -19,6 +19,7 @@ add_library(uuid STATIC
uuid_time.c
)
target_compile_options(uuid PRIVATE -include "${CMAKE_CURRENT_BINARY_DIR}/config.h")
target_include_directories(uuid PUBLIC "$<INSTALL_INTERFACE:include>")
add_executable(test_uuid test_uuid.c)
target_link_libraries(test_uuid uuid)

View File

@ -1,7 +1,7 @@
{
"name": "libuuid",
"version": "1.0.3",
"port-version": 12,
"port-version": 13,
"description": "Universally unique id library",
"homepage": "https://sourceforge.net/projects/libuuid",
"supports": "!osx & !windows",

View File

@ -0,0 +1,38 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4c06409..29f53c0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -95,6 +95,12 @@ ADD_LIBRARY(common_obj_static OBJECT ${common_src})
SET_TARGET_PROPERTIES(common_obj_static PROPERTIES
POSITION_INDEPENDENT_CODE ON
COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1")
+ IF(WIN32 OR APPLE)
+ ELSE()
+ find_package(unofficial-libuuid CONFIG REQUIRED)
+ target_link_libraries(common_obj_static PRIVATE unofficial::UUID::uuid)
+ target_compile_definitions(common_obj_static PUBLIC LIBUUID)
+ ENDIF()
ENDIF()
IF (PAHO_BUILD_SHARED)
@@ -149,7 +155,6 @@ ENDIF()
IF (PAHO_BUILD_STATIC)
ADD_LIBRARY(paho-mqtt3c-static STATIC $<TARGET_OBJECTS:common_obj_static> MQTTClient.c)
ADD_LIBRARY(paho-mqtt3a-static STATIC $<TARGET_OBJECTS:common_obj_static> MQTTAsync.c MQTTAsyncUtils.c)
-
TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM})
TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM})
IF (NOT WIN32)
@@ -249,6 +254,12 @@ IF (PAHO_WITH_SSL)
TARGET_INCLUDE_DIRECTORIES(common_ssl_obj_static PUBLIC ${OPENSSL_INCLUDE_DIR})
SET_PROPERTY(TARGET common_ssl_obj_static PROPERTY POSITION_INDEPENDENT_CODE ON)
SET_PROPERTY(TARGET common_ssl_obj_static PROPERTY COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1")
+ IF(WIN32 OR APPLE)
+ ELSE()
+ find_package(unofficial-libuuid CONFIG REQUIRED)
+ target_link_libraries(common_ssl_obj_static PRIVATE unofficial::UUID::uuid)
+ target_compile_definitions(common_ssl_obj_static PUBLIC LIBUUID)
+ ENDIF()
ADD_LIBRARY(paho-mqtt3cs-static STATIC $<TARGET_OBJECTS:common_ssl_obj_static> MQTTClient.c SSLSocket.c)
ADD_LIBRARY(paho-mqtt3as-static STATIC $<TARGET_OBJECTS:common_ssl_obj_static> MQTTAsync.c MQTTAsyncUtils.c SSLSocket.c)

View File

@ -1,11 +1,12 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO eclipse/paho.mqtt.c
REF eff2da4875725509fc97641b118d6badf3e3a08f # v1.3.10
SHA512 5e190ffd978dad0f60b70bdad2727e567539aff2c55e38023dfbcbe9b50bcbe75d8230c501c09e9c0a0329bed3fd149d5d59d65ad0ba0f84a54f641b4f01390a
REF "v${VERSION}"
SHA512 3152b557a8ab7c9b9c80277283e0f5e9965ce4c2ebbdaef0f238908d49e6fa1281aa72932ea112a836144b79656e4abe6e0cbd93840429a52e501a2c6b12d313
HEAD_REF master
PATCHES
fix-unresolvedsymbol-arm.patch
fix-ODR-libuuid-linux.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PAHO_BUILD_STATIC)
@ -28,14 +29,24 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_copy_tools(TOOL_NAMES MQTTVersion AUTO_CLEAN)
endif()
if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_OSX)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/eclipse-paho-mqtt-c/eclipse-paho-mqtt-cConfig.cmake"
[[# Generated by CMake]]
[[# Generated by CMake
include(CMakeFindDependencyMacro)
find_dependency(OpenSSL)]]
)
else()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/eclipse-paho-mqtt-c/eclipse-paho-mqtt-cConfig.cmake"
[[# Generated by CMake]]
[[# Generated by CMake
include(CMakeFindDependencyMacro)
find_dependency(OpenSSL)
find_dependency(unofficial-libuuid CONFIG)]]
)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -1,10 +1,14 @@
{
"name": "paho-mqtt",
"version-semver": "1.3.10",
"version": "1.3.12",
"description": "Paho project provides open-source client implementations of MQTT and MQTT-SN messaging protocols aimed at new, existing, and emerging applications for the Internet of Things",
"homepage": "https://github.com/eclipse/paho.mqtt.c",
"license": "EPL-2.0",
"dependencies": [
{
"name": "libuuid",
"platform": "!osx & !windows"
},
"openssl",
{
"name": "vcpkg-cmake",

View File

@ -4618,7 +4618,7 @@
},
"libuuid": {
"baseline": "1.0.3",
"port-version": 12
"port-version": 13
},
"libuv": {
"baseline": "1.44.2",
@ -5993,7 +5993,7 @@
"port-version": 0
},
"paho-mqtt": {
"baseline": "1.3.10",
"baseline": "1.3.12",
"port-version": 0
},
"paho-mqttpp3": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "356948d66a6dd59bd830d26c78d1df673de20ea1",
"version": "1.0.3",
"port-version": 13
},
{
"git-tree": "70aca4a70f3235201b05de87aa7ee6258d7c0231",
"version": "1.0.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "db58caf818518c074d1ab00297ce3a2fc784bc0a",
"version": "1.3.12",
"port-version": 0
},
{
"git-tree": "9edde45ee5a278ee52bbb1891e9a30cab33669f8",
"version-semver": "1.3.10",