File tree Expand file tree Collapse file tree 11 files changed +127
-65
lines changed
Expand file tree Collapse file tree 11 files changed +127
-65
lines changed Original file line number Diff line number Diff line change 11[submodule "third_party/mosquitto "]
22 path = third_party/mosquitto
33 url = https://github.com/eclipse/mosquitto
4+ tag = v1.6.2
Original file line number Diff line number Diff line change 1515 - OS=fedora DIST=26
1616 - OS=fedora DIST=27
1717 - OS=ubuntu DIST=xenial
18- - OS=ubuntu DIST=artful
1918 - OS=ubuntu DIST=bionic
2019 - OS=ubuntu DIST=cosmic
2120 - OS=debian DIST=jessie
Original file line number Diff line number Diff line change @@ -8,19 +8,20 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
88find_package (Tarantool REQUIRED)
99include_directories (${TARANTOOL_INCLUDE_DIRS} )
1010
11- find_package (Mosquitto REQUIRED)
12- include_directories (${MOSQUITTO_INCLUDE_DIRS} )
11+ if (NOT DEFINED STATIC_BUILD)
12+ find_package (Mosquitto REQUIRED)
13+ include_directories (${MOSQUITTO_INCLUDE_DIRS} )
14+ message (STATUS "libmosquitto: ${MOSQUITTO_INCLUDE_DIRS} ${MOSQUITTO_LIBRARIES} " )
15+ endif ()
1316
1417message (STATUS "tarantool: ${TARANTOOL_INCLUDE_DIRS} " )
15- message (STATUS "libmosquitto: ${MOSQUITTO_INCLUDE_DIRS} ${MOSQUITTO_LIBRARIES} " )
1618
1719# Set CFLAGS
1820set (MY_C_FLAGS "-Wall -Wextra -Werror -std=gnu11 -fno-strict-aliasing" )
1921set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS} " )
2022set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${MY_C_FLAGS} " )
2123
22- include_directories (${TARANTOOL_INCLUDE_DIRS}
23- ${MOSQUITTO_INCLUDE_DIRS} )
24+ include_directories (${TARANTOOL_INCLUDE_DIRS} )
2425
2526# Build module
2627add_subdirectory (mqtt)
Original file line number Diff line number Diff line change @@ -39,18 +39,19 @@ Key features:
3939## Prerequisites
4040-------------------------------
4141
42- Before reading any further, make sure you have an MQTT broker installed.
42+ Before reading any further, make sure you have an MQTT broker installed or use static build by passing ** STATIC_BUILD ** flags to cmake .
4343
4444### Building from source
4545
46- Clone the repository with submodules, bootstrap, and build the client:
46+ Clone the repository with submodules and build the client:
4747
4848``` bash
4949$ git clone https://github.com/tarantool/mqtt.git
5050$ cd mqtt
5151$ git submodule update --init --recursive
52- $ ./bootstrap.sh
53- $ make -C build
52+ $ mkdir build && cd build
53+ $ cmake ..
54+ $ make -j
5455```
5556
5657[ Back to content] ( #content )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11# driver
22
3- add_library (driver SHARED driver.c)
3+ # we don't need to build documentation for mosquitto
4+ option (DOCUMENTATION "Build documentation?" OFF )
5+
6+ option (WITH_STATIC_LIBRARIES "Build static versions of the libmosquitto/pp libraries?" OFF )
7+
8+ if ( STATIC_BUILD )
9+ set (WITH_STATIC_LIBRARIES ON )
10+ set (OPENSSL_USE_STATIC_LIBS ON )
11+ endif ()
412
513set (LDFLAGS_EX "" )
614if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
715 set (LDFLAGS_EX ${LDFLAGS_EX} "-undefined dynamic_lookup" )
816endif ()
917
10- message ( STATUS ${MOSQUITTO_LIBRARIES} )
18+ add_library (driver SHARED driver.c )
1119
12- target_link_libraries (driver ${MOSQUITTO_LIBRARIES} ${LDFLAGS_EX} -rdynamic)
13- set_target_properties (driver PROPERTIES PREFIX "" OUTPUT_NAME "driver" )
20+ if ( DEFINED STATIC_BUILD )
21+ unset (CMAKE_C_FLAGS)
22+ add_subdirectory (../third_party/mosquitto ../third_party/mosquitto/build )
23+ if ( STATIC_BUILD )
24+ target_link_libraries (driver libmosquitto_static ${LDFLAGS_EX} )
25+ else ()
26+ target_link_libraries (driver libmosquitto ${LDFLAGS_EX} -rdynamic)
27+ endif ()
28+ else ()
29+ target_link_libraries (driver ${MOSQUITTO_LIBRARIES} ${LDFLAGS_EX} )
30+ endif ()
31+ set_target_properties (driver PROPERTIES PREFIX "" OUTPUT_NAME driver)
1432
15- install (TARGETS driver LIBRARY DESTINATION ${TARANTOOL_INSTALL_LIBDIR} /mqtt)
33+ install (TARGETS driver DESTINATION ${TARANTOOL_INSTALL_LIBDIR} /mqtt)
1634install (FILES init.lua DESTINATION ${TARANTOOL_INSTALL_LUADIR} /mqtt)
Original file line number Diff line number Diff line change 1+ package = " mqtt"
2+ version = " 1.2.1-2"
3+ source = {
4+ url = " git://github.com/tarantool/mqtt.git" ,
5+ tag = " 1.2.1"
6+ }
7+ description = {
8+ summary = " Mqtt connector for Tarantool" ,
9+ homepage = " https://github.com/tarantool/mqtt" ,
10+ license = " BSD"
11+ }
12+ dependencies = {
13+ " lua >= 5.1"
14+ }
15+ build = {
16+ type = " cmake" ;
17+ variables = {
18+ CMAKE_BUILD_TYPE = " RelWithDebInfo" ;
19+ TARANTOOL_INSTALL_LIBDIR = " $(LIBDIR)" ;
20+ TARANTOOL_INSTALL_LUADIR = " $(LUADIR)" ;
21+ STATIC_BUILD = " $(STATIC_BUILD)" ;
22+ };
23+ platforms = {
24+ macosx = {
25+ variables = {
26+ OPENSSL_ROOT_DIR = " /usr/local/opt/openssl" ;
27+ };
28+ };
29+ };
30+ }
Original file line number Diff line number Diff line change 1+ package = " mqtt"
2+ version = " 1.4.0-2"
3+ source = {
4+ url = " git://github.com/tarantool/mqtt.git" ,
5+ tag = " 1.4.0"
6+ }
7+ description = {
8+ summary = " Mqtt connector for Tarantool" ,
9+ homepage = " https://github.com/tarantool/mqtt" ,
10+ license = " BSD"
11+ }
12+ dependencies = {
13+ " lua >= 5.1"
14+ }
15+ build = {
16+ type = " cmake" ;
17+ variables = {
18+ CMAKE_BUILD_TYPE = " RelWithDebInfo" ;
19+ TARANTOOL_INSTALL_LIBDIR = " $(LIBDIR)" ;
20+ TARANTOOL_INSTALL_LUADIR = " $(LUADIR)" ;
21+ STATIC_BUILD = " $(STATIC_BUILD)" ;
22+ OPENSSL_ROOT_DIR = " /usr/local/opt/openssl" ;
23+ };
24+ platforms = {
25+ macosx = {
26+ variables = {
27+ OPENSSL_ROOT_DIR = " /usr/local/opt/openssl" ;
28+ };
29+ };
30+ };
31+ }
Original file line number Diff line number Diff line change 1+ package = " mqtt"
2+ version = " scm-2"
3+ source = {
4+ url = " git://github.com/tarantool/mqtt.git" ,
5+ tag = " master"
6+ }
7+ description = {
8+ summary = " Mqtt connector for Tarantool" ,
9+ homepage = " https://github.com/tarantool/mqtt" ,
10+ license = " BSD"
11+ }
12+ dependencies = {
13+ " lua >= 5.1"
14+ }
15+ build = {
16+ type = " cmake" ;
17+ variables = {
18+ CMAKE_BUILD_TYPE = " RelWithDebInfo" ;
19+ TARANTOOL_INSTALL_LIBDIR = " $(LIBDIR)" ;
20+ TARANTOOL_INSTALL_LUADIR = " $(LUADIR)" ;
21+ STATIC_BUILD = " $(STATIC_BUILD)" ;
22+ };
23+ platforms = {
24+ macosx = {
25+ variables = {
26+ OPENSSL_ROOT_DIR = " /usr/local/opt/openssl" ;
27+ };
28+ };
29+ };
30+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments