File tree Expand file tree Collapse file tree 13 files changed +768
-624
lines changed
Expand file tree Collapse file tree 13 files changed +768
-624
lines changed Original file line number Diff line number Diff line change 1+ .DS_Store
2+
13* .o
24* .lib
35* .a
46* .so
57* .so. *
68* .dylib
79
8- test /out
910build
1011CMakeCache.txt
1112CMakeFiles
13+ Makefile
14+ * .snap
15+ * .xlog
16+ cmake_install.cmake
Original file line number Diff line number Diff line change @@ -11,10 +11,21 @@ include_directories(${TARANTOOL_INCLUDE_DIRS})
1111find_package (Mosquitto REQUIRED)
1212include_directories (${MOSQUITTO_INCLUDE_DIRS} )
1313
14+ message (STATUS "tarantool: ${TARANTOOL_INCLUDE_DIRS} " )
15+ message (STATUS "libmosquitto: ${MOSQUITTO_INCLUDE_DIRS} ${MOSQUITTO_LIBRARIES} " )
16+
1417# Set CFLAGS
15- set (MY_C_FLAGS "-Wall -Wextra -Werror -pedantic - std=gnu99 " )
18+ set (MY_C_FLAGS "-Wall -Wextra -Werror -std=gnu11 -fno-strict-aliasing " )
1619set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS} " )
1720set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${MY_C_FLAGS} " )
1821
22+ include_directories (${TARANTOOL_INCLUDE_DIRS}
23+ ${MOSQUITTO_INCLUDE_DIRS} )
24+
1925# Build module
2026add_subdirectory (mqtt)
27+
28+ add_custom_target (test
29+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
30+ COMMAND ${CMAKE_CURRENT_SOURCE_DIR} /tests/run.sh
31+ DEPENDS driver)
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -e
3+ set -e -x
44
5+ # Deps
56cd third_party
67./bootstrap.sh
78cd -
89
9- mkdir -p build
10+ # Common
11+ rm -r build && mkdir -p build && cd build
1012
11- cd build
13+ if [[ " $OSTYPE " == " darwin" * ]]; then
14+ LIBS=$PWD /../third_party/mosquitto/build/lib/libmosquitto.dylib
15+ else
16+ LIBS=$PWD /../third_party/mosquitto/build/lib/libmosquitto.so
17+ fi
1218
1319cmake \
1420 -DMOSQUITTO_INCLUDE_DIR=$PWD /../third_party/mosquitto/lib/mosquitto.h \
15- -DMOSQUITTO_LIBRARY=$PWD /../third_party/mosquitto/build/lib/libmosquitto.so \
21+ -DMOSQUITTO_LIBRARY=${LIBS} \
1622 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
1723../
1824
Original file line number Diff line number Diff line change 1+ # driver
2+
13add_library (driver SHARED driver.c)
4+
5+ set (LDFLAGS_EX "" )
6+ if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
7+ set (LDFLAGS_EX ${LDFLAGS_EX} "-undefined dynamic_lookup" )
8+ endif ()
9+
210message (STATUS ${MOSQUITTO_LIBRARIES} )
3- target_link_libraries (driver ${MOSQUITTO_LIBRARIES} -rdynamic)
11+
12+ target_link_libraries (driver ${MOSQUITTO_LIBRARIES} ${LDFLAGS_EX} -rdynamic)
413set_target_properties (driver PROPERTIES PREFIX "" OUTPUT_NAME "driver" )
14+
515install (TARGETS driver LIBRARY DESTINATION ${TARANTOOL_INSTALL_LIBDIR} /mqtt)
616install (FILES init.lua DESTINATION ${TARANTOOL_INSTALL_LUADIR} /mqtt)
You can’t perform that action at this time.
0 commit comments