mirror of
https://github.com/neovim/neovim.git
synced 2025-12-17 03:45:42 +00:00
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.
This commit is contained in:
52
third-party/cmake/BuildLuarocks.cmake
vendored
52
third-party/cmake/BuildLuarocks.cmake
vendored
@@ -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,6 +30,30 @@ if(USE_BUNDLED_LUAJIT)
|
||||
add_dependencies(luarocks luajit)
|
||||
endif()
|
||||
|
||||
# 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 luarocks)
|
||||
add_custom_target(lua-messagepack
|
||||
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/lua-messagepack)
|
||||
|
||||
# Like before, depend on lua-messagepack to ensure serialization of install
|
||||
# commands
|
||||
add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/lpeg
|
||||
COMMAND ${DEPS_BIN_DIR}/luarocks
|
||||
ARGS build lpeg CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
|
||||
DEPENDS lua-messagepack)
|
||||
add_custom_target(lpeg
|
||||
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/lpeg)
|
||||
|
||||
list(APPEND THIRD_PARTY_DEPS lua-messagepack lpeg)
|
||||
|
||||
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}
|
||||
@@ -50,7 +76,7 @@ add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps
|
||||
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)
|
||||
DEPENDS lpeg)
|
||||
add_custom_target(stable-busted-deps
|
||||
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps)
|
||||
|
||||
@@ -61,30 +87,12 @@ add_custom_command(OUTPUT ${DEPS_BIN_DIR}/busted
|
||||
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.
|
||||
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)
|
||||
add_custom_target(lua-messagepack
|
||||
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/lua-messagepack)
|
||||
|
||||
# Like before, depend on lua-messagepack to ensure serialization of install
|
||||
# commands
|
||||
add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/lpeg
|
||||
COMMAND ${DEPS_BIN_DIR}/luarocks
|
||||
ARGS build lpeg CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
|
||||
DEPENDS lua-messagepack)
|
||||
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)
|
||||
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 lua-messagepack lpeg nvim-client)
|
||||
list(APPEND THIRD_PARTY_DEPS stable-busted-deps busted nvim-client)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user