diff --git a/cmake/define.inc b/cmake/define.inc index 5a66625065259cd3d7f4491c6e7bcbb46f9d59f2..7e6293c9a9abdc82313b9d3982692b5d506f2a06 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -193,8 +193,10 @@ ENDIF () IF (TD_BUILD_LUA) MESSAGE("Enable lua") ADD_DEFINITIONS(-DLUA_EMBEDDED) + SET(LINK_LUA "lua") ELSE () MESSAGE("Disable lua") + SET(LINK_LUA "") ENDIF () IF (TD_LINUX) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index e508b66a16a0c14f99ac6cbd14445882f42513c3..48d3fe8675f7c5ab0e1f0678a269b03bc154a337 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -26,7 +26,7 @@ IF (TD_LINUX) ADD_LIBRARY(taos SHARED ${SRC}) TARGET_LINK_LIBRARIES(taos common query trpc tutil pthread m rt cJson) IF (TD_LINUX_64) - TARGET_LINK_LIBRARIES(taos lua cJson) + TARGET_LINK_LIBRARIES(taos ${LINK_LUA} cJson) ENDIF () SET_TARGET_PROPERTIES(taos PROPERTIES CLEAN_DIRECT_OUTPUT 1) @@ -45,13 +45,13 @@ ELSEIF (TD_DARWIN) # set the static lib name ADD_LIBRARY(taos_static STATIC ${SRC}) - TARGET_LINK_LIBRARIES(taos_static common query trpc tutil pthread m lua cJson) + TARGET_LINK_LIBRARIES(taos_static common query trpc tutil pthread m ${LINK_LUA} cJson) SET_TARGET_PROPERTIES(taos_static PROPERTIES OUTPUT_NAME "taos_static") SET_TARGET_PROPERTIES(taos_static PROPERTIES CLEAN_DIRECT_OUTPUT 1) # generate dynamic library (*.dylib) ADD_LIBRARY(taos SHARED ${SRC}) - TARGET_LINK_LIBRARIES(taos common query trpc tutil pthread m lua cJson) + TARGET_LINK_LIBRARIES(taos common query trpc tutil pthread m ${LINK_LUA} cJson) SET_TARGET_PROPERTIES(taos PROPERTIES CLEAN_DIRECT_OUTPUT 1) #set version of .dylib @@ -77,7 +77,7 @@ ELSEIF (TD_WINDOWS) IF (NOT TD_GODLL) SET_TARGET_PROPERTIES(taos PROPERTIES LINK_FLAGS /DEF:${TD_COMMUNITY_DIR}/src/client/src/taos.def) ENDIF () - TARGET_LINK_LIBRARIES(taos trpc tutil query lua cJson) + TARGET_LINK_LIBRARIES(taos trpc tutil query ${LINK_LUA} cJson) ELSEIF (TD_DARWIN) SET(CMAKE_MACOSX_RPATH 1) @@ -85,12 +85,12 @@ ELSEIF (TD_DARWIN) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc) ADD_LIBRARY(taos_static STATIC ${SRC}) - TARGET_LINK_LIBRARIES(taos_static query trpc tutil pthread m lua cJson) + TARGET_LINK_LIBRARIES(taos_static query trpc tutil pthread m ${LINK_LUA} cJson) SET_TARGET_PROPERTIES(taos_static PROPERTIES OUTPUT_NAME "taos_static") # generate dynamic library (*.dylib) ADD_LIBRARY(taos SHARED ${SRC}) - TARGET_LINK_LIBRARIES(taos query trpc tutil pthread m lua cJson) + TARGET_LINK_LIBRARIES(taos query trpc tutil pthread m ${LINK_LUA} cJson) SET_TARGET_PROPERTIES(taos PROPERTIES CLEAN_DIRECT_OUTPUT 1) diff --git a/src/dnode/CMakeLists.txt b/src/dnode/CMakeLists.txt index dd3f88ecbc90e1e74f0acf9345a7e1719ca112a0..ac91b498309bd951fab5860b223162ef40aff606 100644 --- a/src/dnode/CMakeLists.txt +++ b/src/dnode/CMakeLists.txt @@ -24,9 +24,9 @@ IF (TD_LINUX_64 AND JEMALLOC_ENABLED) ENDIF () IF (TD_BUILD_HTTP) -TARGET_LINK_LIBRARIES(taosd mnode monitor http tsdb twal vnode cJson lua lz4 balance sync ${LINK_JEMALLOC}) + TARGET_LINK_LIBRARIES(taosd mnode monitor http tsdb twal vnode cJson ${LINK_LUA} lz4 balance sync ${LINK_JEMALLOC}) ELSE () -TARGET_LINK_LIBRARIES(taosd mnode monitor tsdb twal vnode cJson lua lz4 balance sync ${LINK_JEMALLOC}) + TARGET_LINK_LIBRARIES(taosd mnode monitor tsdb twal vnode cJson ${LINK_LUA} lz4 balance sync ${LINK_JEMALLOC}) ENDIF () IF (TD_SOMODE_STATIC) diff --git a/src/kit/shell/CMakeLists.txt b/src/kit/shell/CMakeLists.txt index 7230701add8591c1995dc6b2e7e23ed03335f6f1..db572c9d310709dc6fe024b351126679ea9805e1 100644 --- a/src/kit/shell/CMakeLists.txt +++ b/src/kit/shell/CMakeLists.txt @@ -19,9 +19,9 @@ ELSE () ENDIF () IF (TD_SOMODE_STATIC) - TARGET_LINK_LIBRARIES(shell taos_static cJson lua ${LINK_JEMALLOC}) + TARGET_LINK_LIBRARIES(shell taos_static cJson ${LINK_LUA} ${LINK_JEMALLOC}) ELSE () - TARGET_LINK_LIBRARIES(shell taos cJson lua ${LINK_JEMALLOC}) + TARGET_LINK_LIBRARIES(shell taos cJson ${LINK_LUA} ${LINK_JEMALLOC}) ENDIF () SET_TARGET_PROPERTIES(shell PROPERTIES OUTPUT_NAME taos) diff --git a/src/query/CMakeLists.txt b/src/query/CMakeLists.txt index a815942fbedb4f3b99e3595c3960d931ddde192a..37bf80ae5dcac8c9ee4d4816cc55ea9de5a81693 100644 --- a/src/query/CMakeLists.txt +++ b/src/query/CMakeLists.txt @@ -8,11 +8,11 @@ INCLUDE_DIRECTORIES(inc) AUX_SOURCE_DIRECTORY(src SRC) ADD_LIBRARY(query ${SRC}) SET_SOURCE_FILES_PROPERTIES(src/sql.c PROPERTIES COMPILE_FLAGS -w) -TARGET_LINK_LIBRARIES(query tsdb tutil lua) +TARGET_LINK_LIBRARIES(query tsdb tutil ${LINK_LUA}) IF (TD_LINUX) IF (TD_BUILD_LUA) - TARGET_LINK_LIBRARIES(query m rt lua) + TARGET_LINK_LIBRARIES(query m rt ${LINK_LUA}) ELSE () TARGET_LINK_LIBRARIES(query m rt) ENDIF () @@ -21,7 +21,7 @@ ENDIF () IF (TD_DARWIN) IF (TD_BUILD_LUA) - TARGET_LINK_LIBRARIES(query m lua) + TARGET_LINK_LIBRARIES(query m ${LINK_LUA}) ELSE () TARGET_LINK_LIBRARIES(query m) ENDIF () diff --git a/tests/examples/c/CMakeLists.txt b/tests/examples/c/CMakeLists.txt index e94de3cbca574de71c8bcefc4b52173922c05a98..9d5dfc37b1045cb771cf6bd20da7087d7523e2e2 100644 --- a/tests/examples/c/CMakeLists.txt +++ b/tests/examples/c/CMakeLists.txt @@ -10,13 +10,13 @@ IF (TD_LINUX) ADD_EXECUTABLE(subscribe subscribe.c) TARGET_LINK_LIBRARIES(subscribe taos_static trpc tutil pthread ) ADD_EXECUTABLE(epoll epoll.c) - TARGET_LINK_LIBRARIES(epoll taos_static trpc tutil pthread lua) + TARGET_LINK_LIBRARIES(epoll taos_static trpc tutil pthread ${LINK_LUA}) ENDIF () IF (TD_DARWIN) INCLUDE_DIRECTORIES(. ${TD_COMMUNITY_DIR}/src/inc ${TD_COMMUNITY_DIR}/src/client/inc ${TD_COMMUNITY_DIR}/inc) AUX_SOURCE_DIRECTORY(. SRC) ADD_EXECUTABLE(demo demo.c) - TARGET_LINK_LIBRARIES(demo taos_static trpc tutil pthread lua) + TARGET_LINK_LIBRARIES(demo taos_static trpc tutil pthread ${LINK_LUA}) ADD_EXECUTABLE(epoll epoll.c) - TARGET_LINK_LIBRARIES(epoll taos_static trpc tutil pthread lua) + TARGET_LINK_LIBRARIES(epoll taos_static trpc tutil pthread ${LINK_LUA}) ENDIF () diff --git a/tests/examples/lua/luaconnector.so b/tests/examples/lua/luaconnector.so deleted file mode 100755 index 08bf6a6156aebe053132545193cd111fb436bc4b..0000000000000000000000000000000000000000 Binary files a/tests/examples/lua/luaconnector.so and /dev/null differ