Skip to content

Commit e832bf7

Browse files
MiKommarcothaller
andcommitted
Don't leak mosquitto headers
We only use mosquitto types via pointers so we don't need full mosquitto headers to be included in our exported headers. This will make the life of users easier. We'll have only link time dependency. Co-Authored-By: Marco Thaller <[email protected]>
1 parent ef38222 commit e832bf7

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/KDMqtt/mqtt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Contact KDAB at <[email protected]> for commercial licensing options.
1010
*/
1111
#include "mqtt.h"
12+
#include "mosquitto_wrapper.h"
1213
#include <memory>
1314
#include <spdlog/spdlog.h>
1415

src/KDMqtt/mqtt.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <KDFoundation/file_descriptor_notifier.h>
1414
#include <KDFoundation/timer.h>
1515
#include <KDMqtt/kdmqtt_global.h>
16-
#include <KDMqtt/mosquitto_wrapper.h>
1716
#include <KDUtils/bytearray.h>
1817
#include <KDUtils/file.h>
1918
#include <KDUtils/flags.h>
@@ -28,12 +27,16 @@
2827
using namespace KDFoundation;
2928
using namespace KDUtils;
3029

30+
struct mosquitto_message;
31+
3132
namespace KDMqtt {
3233

3334
constexpr int c_defaultPort = 1883;
3435
constexpr std::chrono::duration c_defaultKeepAlive = std::chrono::minutes(1);
3536

3637
class IMqttClient;
38+
class MosquittoLib;
39+
class MosquittoClient;
3740

3841
/*
3942
* Class: IMqttManager

tests/auto/mqtt/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ add_executable(
3030

3131
target_include_directories(
3232
${PROJECT_NAME}
33-
PRIVATE ${CMAKE_SOURCE_DIR}/tests/auto/foundation/common ${CMAKE_BINARY_DIR}/tests/auto
33+
PRIVATE ${CMAKE_SOURCE_DIR}/src/KDMqtt ${CMAKE_SOURCE_DIR}/tests/auto/foundation/common
34+
${CMAKE_BINARY_DIR}/tests/auto
3435
)
3536

3637
target_link_libraries(

tests/auto/mqtt/tst_mqtt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <KDFoundation/core_application.h>
1212
#include <KDMqtt/mqtt.h>
1313
#include <memory>
14+
#include "mosquitto_wrapper.h"
1415

1516
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
1617
#include <doctest/doctest.h>

0 commit comments

Comments
 (0)