mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-02-05 18:50:06 +08:00
Windows build fixes
This commit is contained in:
@@ -37,6 +37,10 @@ if(WITH_TLS)
|
||||
target_link_libraries(mosquitto_db_dump PRIVATE config-header OpenSSL::SSL)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(mosquitto_db_dump PRIVATE ws2_32)
|
||||
endif()
|
||||
|
||||
target_link_libraries(mosquitto_db_dump PRIVATE libmosquitto_common)
|
||||
|
||||
install(TARGETS mosquitto_db_dump
|
||||
|
||||
@@ -748,7 +748,8 @@ libmosqcommon_EXPORT int mosquitto_string_to_property_info(const char *propname,
|
||||
libmosqcommon_EXPORT void mosquitto_property_free(mosquitto_property **property);
|
||||
libmosqcommon_EXPORT unsigned int mosquitto_property_get_length(const mosquitto_property *property);
|
||||
libmosqcommon_EXPORT unsigned int mosquitto_property_get_length_all(const mosquitto_property *property);
|
||||
libmosqcommon_EXPORT unsigned int mosquitto_property_get_remaining_length(const mosquitto_property *props);
|
||||
libmosqcommon_EXPORT unsigned int mosquitto_property_get_remaining_length(const mosquitto_property* props);
|
||||
libmosqcommon_EXPORT unsigned int mosquitto_varint_bytes(uint32_t word);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -291,6 +291,4 @@ enum mqtt5_sub_options {
|
||||
#define MQTT_SUB_OPT_SET(opt, val) ((opt) |= val)
|
||||
#define MQTT_SUB_OPT_CLEAR(opt, val) ((opt) = (opt) & !val)
|
||||
|
||||
unsigned int mosquitto_varint_bytes(uint32_t size);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -53,7 +53,7 @@ if (WITH_THREADING AND WIN32)
|
||||
list(APPEND C_SRC "../common/winthread_mosq.c" "../common/winthread_mosq.h")
|
||||
endif()
|
||||
|
||||
set(LIBRARIES common-options libmosquitto_common)
|
||||
set(LIBRARIES common-options)
|
||||
|
||||
if(WITH_TLS)
|
||||
set (LIBRARIES ${LIBRARIES} OpenSSL::SSL)
|
||||
@@ -122,6 +122,10 @@ if (WITH_THREADING AND NOT WIN32)
|
||||
target_link_libraries(libmosquitto PRIVATE Threads::Threads)
|
||||
endif()
|
||||
|
||||
target_link_libraries(libmosquitto
|
||||
PUBLIC
|
||||
libmosquitto_common
|
||||
)
|
||||
target_link_libraries(libmosquitto PRIVATE ${LIBRARIES})
|
||||
|
||||
set_target_properties(libmosquitto PROPERTIES
|
||||
|
||||
@@ -9,6 +9,17 @@ set(C_SRC
|
||||
time_common.c
|
||||
topic_common.c
|
||||
utf8_common.c
|
||||
|
||||
"${mosquitto_SOURCE_DIR}/include/mosquitto/libcommon.h"
|
||||
"${mosquitto_SOURCE_DIR}/include/mosquitto/libcommon_base64.h"
|
||||
"${mosquitto_SOURCE_DIR}/include/mosquitto/libcommon_file.h"
|
||||
"${mosquitto_SOURCE_DIR}/include/mosquitto/libcommon_memory.h"
|
||||
"${mosquitto_SOURCE_DIR}/include/mosquitto/libcommon_properties.h"
|
||||
"${mosquitto_SOURCE_DIR}/include/mosquitto/libcommon_random.h"
|
||||
"${mosquitto_SOURCE_DIR}/include/mosquitto/libcommon_string.h"
|
||||
"${mosquitto_SOURCE_DIR}/include/mosquitto/libcommon_time.h"
|
||||
"${mosquitto_SOURCE_DIR}/include/mosquitto/libcommon_topic.h"
|
||||
"${mosquitto_SOURCE_DIR}/include/mosquitto/libcommon_utf8.h"
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
|
||||
@@ -21,7 +21,13 @@ Contributors:
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "memory_common.h"
|
||||
#include "mosquitto.h"
|
||||
|
||||
#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER)
|
||||
# if defined(__APPLE__) || defined(__FreeBSD__) || defined(__GLIBC__)
|
||||
# define REAL_WITH_MEMORY_TRACKING
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef REAL_WITH_MEMORY_TRACKING
|
||||
# if defined(__APPLE__)
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2010-2021 Roger Light <roger@atchoo.org>
|
||||
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Eclipse Public License 2.0
|
||||
and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
|
||||
The Eclipse Public License is available at
|
||||
https://www.eclipse.org/legal/epl-2.0/
|
||||
and the Eclipse Distribution License is available at
|
||||
http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
|
||||
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||
|
||||
Contributors:
|
||||
Roger Light - initial implementation and documentation.
|
||||
*/
|
||||
|
||||
#ifndef MEMORY_MOSQ_H
|
||||
#define MEMORY_MOSQ_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER)
|
||||
# if defined(__APPLE__) || defined(__FreeBSD__) || defined(__GLIBC__)
|
||||
# define REAL_WITH_MEMORY_TRACKING
|
||||
# endif
|
||||
#endif
|
||||
|
||||
void *mosquitto__calloc(size_t nmemb, size_t size);
|
||||
void mosquitto_free(void *mem);
|
||||
void *mosquitto_malloc(size_t size);
|
||||
#ifdef REAL_WITH_MEMORY_TRACKING
|
||||
unsigned long mosquitto__memory_used(void);
|
||||
unsigned long mosquitto__max_memory_used(void);
|
||||
#endif
|
||||
void *mosquitto_realloc(void *ptr, size_t size);
|
||||
char *mosquitto_strdup(const char *s);
|
||||
char *mosquitto__strndup(const char *s, size_t n);
|
||||
|
||||
#ifdef WITH_BROKER
|
||||
void memory__set_limit(size_t lim);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -20,7 +20,7 @@ Contributors:
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "mosquitto/mqtt_protocol.h"
|
||||
#include "mosquitto.h"
|
||||
|
||||
|
||||
unsigned int mosquitto_varint_bytes(uint32_t word)
|
||||
|
||||
@@ -26,7 +26,7 @@ Contributors:
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "mosquitto/mqtt_protocol.h"
|
||||
#include "mosquitto.h"
|
||||
#include "property_common.h"
|
||||
|
||||
|
||||
|
||||
@@ -34,5 +34,11 @@ if(WITH_TLS)
|
||||
OpenSSL::SSL
|
||||
)
|
||||
|
||||
if(ARGON2_FOUND)
|
||||
set(LINKLIST
|
||||
"${LINKLIST}"
|
||||
argon2
|
||||
)
|
||||
endif()
|
||||
add_mosquitto_plugin("${PLUGIN_NAME}" "${SRCLIST}" "${INCLIST}" "${LINKLIST}")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user