aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Abreu Ferreira <raf-ep@gmx.com>2015-04-18 00:02:28 +0100
committerRui Abreu Ferreira <raf-ep@gmx.com>2015-04-22 13:45:57 +0100
commitfe9ec9c29956cb2bd4062d3e582412006d42292e (patch)
treebc4368a91e11f7c291b7433af47b54b82669c983
parent84891f2802a0db1a257580f341d70a5fdb0f6c75 (diff)
downloadrneovim-fe9ec9c29956cb2bd4062d3e582412006d42292e.tar.gz
rneovim-fe9ec9c29956cb2bd4062d3e582412006d42292e.tar.bz2
rneovim-fe9ec9c29956cb2bd4062d3e582412006d42292e.zip
Add option USE_BUNDLED_BUSTED to third-party
- When not running the unit tests, building the third-party busted, nvim-client and other dependencies can be skipped by passing -DUSE_BUNDLED_BUSTED=FALSE to the third-party project.
-rw-r--r--third-party/cmake/BuildLuarocks.cmake96
1 files changed, 52 insertions, 44 deletions
diff --git a/third-party/cmake/BuildLuarocks.cmake b/third-party/cmake/BuildLuarocks.cmake
index 590c41c5d5..c9b6cb49a0 100644
--- a/third-party/cmake/BuildLuarocks.cmake
+++ b/third-party/cmake/BuildLuarocks.cmake
@@ -1,3 +1,5 @@
+option(USE_BUNDLED_BUSTED "Use the bundled version of busted to run tests." ON)
+
if(USE_BUNDLED_LUAJIT)
list(APPEND LUAROCKS_OPTS
--with-lua=${DEPS_INSTALL_DIR}
@@ -28,46 +30,12 @@ if(USE_BUNDLED_LUAJIT)
add_dependencies(luarocks luajit)
endif()
-add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build lua_cliargs 2.3-3 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build luafilesystem 1.6.3-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build dkjson 2.5-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build say 1.3-0 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build luassert 1.7.4-0 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build lua-term 0.1-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build penlight 1.0.0-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build mediator_lua 1.1-3 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build luasocket 3.0rc1-2 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build xml 1.1.1-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- COMMAND touch ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps
- DEPENDS luarocks)
-add_custom_target(stable-busted-deps
- DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps)
-
-add_custom_command(OUTPUT ${DEPS_BIN_DIR}/busted
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build https://raw.githubusercontent.com/Olivine-Labs/busted/master/busted-scm-0.rockspec CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- DEPENDS stable-busted-deps)
-add_custom_target(busted
- DEPENDS ${DEPS_BIN_DIR}/busted)
-
-# lua-messagepack doesn't depend on busted, but luarocks is unhappy to have
-# two instances running in parallel. So we depend on busted to force it to
-# be serialized.
+# Each target depends on the previous module, this serializes all calls to
+# luarocks since it is unhappy to be called in parallel.
add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/lua-messagepack
COMMAND ${DEPS_BIN_DIR}/luarocks
ARGS build lua-messagepack CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
- DEPENDS busted)
+ DEPENDS luarocks)
add_custom_target(lua-messagepack
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/lua-messagepack)
@@ -80,11 +48,51 @@ add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/lpeg
add_custom_target(lpeg
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/lpeg)
-add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client
- COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build https://raw.githubusercontent.com/neovim/lua-client/8cc5b6090ac61cd0bba53ba984f15792fbb64573/nvim-client-0.0.1-11.rockspec CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER} LIBUV_DIR=${DEPS_INSTALL_DIR}
- DEPENDS lpeg libuv)
-add_custom_target(nvim-client
- DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client)
+list(APPEND THIRD_PARTY_DEPS lua-messagepack lpeg)
-list(APPEND THIRD_PARTY_DEPS stable-busted-deps busted lua-messagepack lpeg nvim-client)
+if(USE_BUNDLED_BUSTED)
+ # The following are only required if we want to run tests
+ # with busted
+
+ add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build lua_cliargs 2.3-3 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build luafilesystem 1.6.3-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build dkjson 2.5-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build say 1.3-0 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build luassert 1.7.4-0 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build lua-term 0.1-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build penlight 1.0.0-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build mediator_lua 1.1-3 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build luasocket 3.0rc1-2 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build xml 1.1.1-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND touch ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps
+ DEPENDS lpeg)
+ add_custom_target(stable-busted-deps
+ DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps)
+
+ add_custom_command(OUTPUT ${DEPS_BIN_DIR}/busted
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build https://raw.githubusercontent.com/Olivine-Labs/busted/master/busted-scm-0.rockspec CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ DEPENDS stable-busted-deps)
+ add_custom_target(busted
+ DEPENDS ${DEPS_BIN_DIR}/busted)
+
+ add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build https://raw.githubusercontent.com/neovim/lua-client/8cc5b6090ac61cd0bba53ba984f15792fbb64573/nvim-client-0.0.1-11.rockspec CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER} LIBUV_DIR=${DEPS_INSTALL_DIR}
+ DEPENDS busted libuv)
+ add_custom_target(nvim-client
+ DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client)
+
+ list(APPEND THIRD_PARTY_DEPS stable-busted-deps busted nvim-client)
+endif()