Open MateuszMiekicki opened 1 year ago
I don't know much about conan.
mqtt_cpp has MQTT_USE_TLS
option for cmake.
See https://github.com/redboltz/mqtt_cpp/blob/3b1dfe2392a3eaad94ca6520d1746323fdf4ee68/example/CMakeLists.txt#L25-L33
Maybe you need to add the option to conan.
If it is not possible I guess that conan repository should be fixed.
It is not a part of mqtt_cpp project. I'm not sure but you can send pull request to conan.
Hi, little by little I succeed in adding the package for the newer package together with the flags. https://github.com/conan-io/conan-center-index/pull/14591
Great work! By the way, mqtt_cpp's preprosessor macro flags are documented https://github.com/redboltz/mqtt_cpp/wiki/Config I'm not sure how it work with conan but it seems that you've already followed those flags on your pull request for conan.
I have bundled all from c++ 17 into one, it seems to make sense to me. Plus I separated for TLS as well as websockets. If there's anything worth including, write away, I'll try to apply it.
I installed the versions from the package manager and cannot compile the examples with TLS. Some files are missing. Is it possible to add an option to make this possible? https://conan.io/center/redboltz-mqtt_cpp
Logs: [1/2] Building CXX object packages/broker/mqtt/src/CMakeFiles/mqtt.dir/Mqtt.cc.obj FAILED: packages/broker/mqtt/src/CMakeFiles/mqtt.dir/Mqtt.cc.obj C:\msys64\mingw64\bin\c++.exe -DBOOST_ALL_NO_LIB -DBOOST_STACKTRACE_USE_NOOP -DBOOST_STACKTRACE_USE_WINDBG -DBOOST_STACKTRACE_USE_WINDBG_CACHED -Dmqtt_EXPORTS -IC:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/../include -isystem C:/Users/haven/.conan/data/redboltz-mqttcpp/13.0.0///package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -isystem C:/.conan/f490c6/1/include -isystem C:/Users/haven/.conan/data/bzip2/1.0.8///package/d16a91eadaaf5829b928b12d2f836ff7680d3df5/include -isystem C:/Users/haven/.conan/data/zlib/1.2.13//_/package/3fb49604f9c2f729b85ba3115852006824e72cab/include -g -Werror -Wall -Wduplicated-cond -Wformat=2 -Weffc++ -Wdouble-promotion -Wuseless-cast -Wnull-dereference -Wlogical-op -Wduplicated-branches -Wmisleading-indentation -Wsign-conversion -Wpedantic -Wconversion -Woverloaded-virtual -Wunused -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -Wold-style-cast -Wcast-align -Wundef -Wpointer-arith -Wstrict-overflow=5 -Wswitch-default -Wunreachable-code -g3 -O0 -std=c++20 -MD -MT packages/broker/mqtt/src/CMakeFiles/mqtt.dir/Mqtt.cc.obj -MF packages\broker\mqtt\src\CMakeFiles\mqtt.dir\Mqtt.cc.obj.d -o packages/broker/mqtt/src/CMakeFiles/mqtt.dir/Mqtt.cc.obj -c C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:17:24: error: 'server_tls' in namespace 'mqtt' does not name a template type; did you mean 'server'? 17 | using con_t = MQTT_NS::server_tls<>::endpoint_t; | ^;
| ^~~~~
| const
C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:18:39: error: template argument 1 is invalid
18 | using con_sp_t = std::shared_ptr;
| ^
C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:18:23: error: '' in namespace 'std' does not name a type
18 | using con_sp_t = std::shared_ptr;
| ^' in namespace 'mi' does not name a type
32 | using mi_sub_con = mi::multi_index_container<
| ^,
| ,
| ,
| & cons, mi_sub_con& subs, con_sp_t const& con) {
| ^& cons, mi_sub_con& subs, con_sp_t const& con) {
| ^
55 | inline void close_proc(std::set& cons, mi_sub_con& subs, con_sp_t const& con) {
| ^
C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:55:41: error: template argument 2 is invalid
C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:55:41: error: template argument 3 is invalid
C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:55:50: error: 'mi_sub_con' has not been declared
55 | inline void close_proc(std::set& cons, mi_sub_con& subs, con_sp_t const& con) {
| ^& cons, mi_sub_con& subs, con_sp_t const& con) {
| ^();
| ^~~
C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:58:33: error: expected primary-expression before '>' token
58 | auto& idx = subs.get();
| ^
C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:58:35: error: expected primary-expression before ')' token
58 | auto& idx = subs.get();
| ^
cc1plus.exe: all warnings being treated as errors
ninja: build stopped: subcommand failed.
~~~~~ | server C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:18:34: error: 'con_t' was not declared in this scope; did you mean 'const'? 18 | using con_sp_t = std::shared_ptr~~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:21:36: error: 'con_sp_t' has not been declared 21 | sub_con(MQTT_NS::buffer topic, con_sp_t con, MQTT_NS::qos qos_value) | ^~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:24:5: error: 'con_sp_t' does not name a type; did you mean 'const'? 24 | con_sp_t con; | ^~~~ | const C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc: In constructor 'sub_con::sub_con(mqtt::buffer, int, mqtt::qos)': C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:21:63: error: declaration of 'qos_value' shadows a member of 'sub_con' [-Werror=shadow] 21 | sub_con(MQTT_NS::buffer topic, con_sp_t con, MQTT_NS::qos qos_value) | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:25:18: note: shadowed declaration is here 25 | MQTT_NS::qos qos_value; | ^~~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:21:29: error: declaration of 'topic' shadows a member of 'sub_con' [-Werror=shadow] 21 | sub_con(MQTT_NS::buffer topic, con_sp_t con, MQTT_NS::qos qos_value) | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:23:21: note: shadowed declaration is here 23 | MQTT_NS::buffer topic; | ^~~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:22:35: error: class 'sub_con' does not have any field named 'con' 22 | :topic(std::move(topic)), con(std::move(con)), qos_value(qos_value) {} | ^~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc: In constructor 'sub_con::sub_con(mqtt::buffer, int, mqtt::qos)': C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:21:63: error: declaration of 'qos_value' shadows a member of 'sub_con' [-Werror=shadow] 21 | sub_con(MQTT_NS::buffer topic, con_sp_t con, MQTT_NS::qos qos_value) | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:25:18: note: shadowed declaration is here 25 | MQTT_NS::qos qos_value; | ^~~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:21:29: error: declaration of 'topic' shadows a member of 'sub_con' [-Werror=shadow] 21 | sub_con(MQTT_NS::buffer topic, con_sp_t con, MQTT_NS::qos qos_value) | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:23:21: note: shadowed declaration is here 23 | MQTT_NS::buffer topic; | ^~~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc: In constructor 'sub_con::sub_con(mqtt::buffer, int, mqtt::qos)': C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:21:63: error: declaration of 'qos_value' shadows a member of 'sub_con' [-Werror=shadow] 21 | sub_con(MQTT_NS::buffer topic, con_sp_t con, MQTT_NS::qos qos_value) | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:25:18: note: shadowed declaration is here 25 | MQTT_NS::qos qos_value; | ^~~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:21:29: error: declaration of 'topic' shadows a member of 'sub_con' [-Werror=shadow] 21 | sub_con(MQTT_NS::buffer topic, con_sp_t con, MQTT_NS::qos qos_value) | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:23:21: note: shadowed declaration is here 23 | MQTT_NS::buffer topic; | ^~~~~ In file included from C:/Users/haven/.conan/data/redboltz-mqttcpp/13.0.0//_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/mqtt/endpoint.hpp:28, from C:/Users/haven/.conan/data/redboltz-mqttcpp/13.0.0//_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/mqtt/server.hpp:18, from C:/Users/haven/.conan/data/redboltz-mqttcpp/13.0.0//_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/mqtt_server_cpp.hpp:9, from C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:7: C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc: At global scope: C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:39:51: error: 'con_sp_t' was not declared in this scope; did you mean 'const'? 39 | BOOST_MULTI_INDEX_MEMBER(sub_con, con_sp_t, con), | ^~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:39:61: error: 'con' is not a member of 'sub_con' 39 | BOOST_MULTI_INDEX_MEMBER(sub_con, con_sp_t, con), | ^~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:39:17: error: template argument 2 is invalid 39 | BOOST_MULTI_INDEX_MEMBER(sub_con, con_sp_t, con), | ^~~~~~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:39:17: error: template argument 3 is invalid C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:41:13: error: template argument 2 is invalid 41 | > | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:42:9: error: template argument 2 is invalid 42 | >, | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:49:47: error: 'con_sp_t' was not declared in this scope; did you mean 'const'? 49 | BOOST_MULTI_INDEX_MEMBER(sub_con, con_sp_t, con) | ^~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:49:57: error: 'con' is not a member of 'sub_con' 49 | BOOST_MULTI_INDEX_MEMBER(sub_con, con_sp_t, con) | ^~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:49:13: error: template argument 2 is invalid 49 | BOOST_MULTI_INDEX_MEMBER(sub_con, con_sp_t, con) | ^~~~~~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:49:13: error: template argument 3 is invalid C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:50:9: error: template argument 2 is invalid 50 | > | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:51:5: error: template argument 1 is invalid 51 | > | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:51:5: error: template argument 3 is invalid C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:52:1: error: template argument 2 is invalid 52 | >; | ^ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:32:24: error: '~~~~~ 33 | sub_con, |~~~~ 34 | mi::indexed_by< |~~~35 | mi::ordered_unique< |~~~~~~~ 36 | mi::tag~~~~~~~ 37 | mi::composite_key< |~~~~~~ 38 | sub_con, |~~~~ 39 | BOOST_MULTI_INDEX_MEMBER(sub_con, con_sp_t, con), |~~~~~~~~~~~~~ 40 | BOOST_MULTI_INDEX_MEMBER(sub_con, MQTT_NS::buffer, topic) |~~~~~~~~~~~~~ 41 | > | ~ 42 | >, | ~~ 43 | mi::ordered_non_unique< |~~~~~~~ 44 | mi::tag~~~~~~~ 45 | BOOST_MULTI_INDEX_MEMBER(sub_con, MQTT_NS::buffer, topic) |~~~~~~~~~~~~~ 46 | >, | ~~ 47 | mi::ordered_non_unique< |~~~~~~~ 48 | mi::tag~~~~~ 49 | BOOST_MULTI_INDEX_MEMBER(sub_con, con_sp_t, con) |~~~~~~~~~~~~ 50 | > | ~ 51 | > | ~ 52 | >; | ~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:55:33: error: 'con_sp_t' was not declared in this scope; did you mean 'const'? 55 | inline void close_proc(std::set~~~ | const C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:55:41: error: template argument 1 is invalid 55 | inline void close_proc(std::set~~~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:55:68: error: 'con_sp_t' has not been declared 55 | inline void close_proc(std::set~~~C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc: In function 'void close_proc(int&, int&, const int&)': C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:56:10: error: request for member 'erase' in 'cons', which is of non-class type 'int' 56 | cons.erase(con); | ^~~~~ C:/Users/haven/Desktop/terrarium/packages/broker/mqtt/src/Mqtt.cc:58:22: error: request for member 'get' in 'subs', which is of non-class type 'int' 58 | auto& idx = subs.get