Skip to content

Commit 01694e6

Browse files
committed
rocks: unable to install with tarantoolctl rocks on Linux
On any platforms many targets from subdirectories are included into make command by default. They are not necessary to build driver.{so|dylib}. EXCLUDE_FROM_ALL option disables all targets at the beginning and only targets which are explicitly added to mqtt dependencies will be built. Static build option for libmosquitto set by default in rocks. That means there is no more need to install libmosquitto manually for successful build from rocks. But there is still an opportunity to add some other build options in CMake, if it is needed. Fixes #39
1 parent 794dc18 commit 01694e6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mqtt-scm-1.rockspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ build = {
1818
CMAKE_BUILD_TYPE="RelWithDebInfo";
1919
TARANTOOL_INSTALL_LIBDIR="$(LIBDIR)";
2020
TARANTOOL_INSTALL_LUADIR="$(LUADIR)";
21-
STATIC_BUILD="$(STATIC_BUILD)";
21+
STATIC_BUILD="ON";
2222
};
2323
platforms = {
2424
macosx = {

mqtt/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
option(DOCUMENTATION "Build documentation?" OFF)
55

66
option(WITH_STATIC_LIBRARIES "Build static versions of the libmosquitto/pp libraries?" OFF)
7+
option(WITH_PIC "Build the static library with PIC (Position Independent Code) enabled archives?" OFF)
78

89
if( STATIC_BUILD )
910
set(WITH_STATIC_LIBRARIES ON)
@@ -20,7 +21,7 @@ add_library(driver SHARED driver.c)
2021

2122
if( DEFINED STATIC_BUILD )
2223
set(CMAKE_C_FLAGS "-ldl -lpthread")
23-
add_subdirectory(../third_party/mosquitto ../third_party/mosquitto/build)
24+
add_subdirectory(../third_party/mosquitto ../third_party/mosquitto/build EXCLUDE_FROM_ALL)
2425
include_directories(../third_party/mosquitto/lib)
2526
if( STATIC_BUILD )
2627
target_link_libraries(driver libmosquitto_static ${LDFLAGS_EX})

0 commit comments

Comments
 (0)