mirror of
https://github.com/neovim/neovim.git
synced 2026-01-03 09:56:25 +10:00
Following is a list of commits (fixes/features only) in this release. See `:help news` in Nvim for release notes. FEATURES -------------------------------------------------------------------------------- -693772100ehelp: gx opens help tag in web browser (#35784) -f9cad88d5avimscript: log function name in "fast" message #32616 PERFORMANCE -------------------------------------------------------------------------------- -4c8486e1f2scheduler priority clamping on macOS #35488 -0f6a180bccapi: reduce redundant `win_find_tabpage` calls (#35643) FIXES -------------------------------------------------------------------------------- -4e4428dee8vim.lsp.omnifunc should not throw away other items #35346 -f2fb46ef9eapi: nvim_open_win default to half-size for splits (#36088) -479bb9cbabapi: nvim_open_win respects requested split window size (#35601) -5aa6257e8capi: win_set_config error message for splitting from a float #35650 -66b8018b06channel: closing socket with pending writes leaks memory (#36400) -3237f634facjson: fix `strbuf_set_length` incorrectness #35565 -95cc67538bclipboard: avoid using stale register width (#36178) -d31953d532diagnostics: extend conversion support from/to quickfix format (#34006) -7304fc275eexcmd: :trust executed even when inside false condition (#36032) -0e1c83fae2filetype: handle invalid `bufnr` in _getlines(), _getline() #36272 -86b2c0f201float: crash from nasty :fclose autocmds (#36137) -d8a7c86e73health: errors in :checkhealth with pyenv-virtualenv #35865 -8e00534b1ehealth: hard fail on invalid "python-*" bin #35382 -2668a46902lsp: "attempt to index nil config" #36189 -21540d21calsp: _get_workspace_folders does not handle root_dir() function (#36141) -14e74d98fdlsp: misleading logs in non-applicable filetypes #35749 -a7eb110098lsp: noisy log message when enabling server without config #36264 -eb4837206alsp: restore Client:stop() force-stopping behavior (#35800) -556d8d0002lsp: treat 2-triggers-at-once as "last char wins" #35435 -7b1ac2080dlua: don't leak handle when vim._watch.watch() fails (#35768) -c84ba83cf1options: increase t_Co buffer size (#35859) -7aea000343paste: don't use :echo immediately before :redraw (#35773) -47f6f21998plines: count 'showbreak' in EOL inline virt_text in line size (#35921) -4338eea269rpc: handle more cases when identifying loopback #36100 -d399ed310esocket: avoid stack-use-after-return after timeout (#36405) -4cc060bf44statusline: redraw if Visual selection other end changes (#36281) -7f5427b857terminal: add various missing redraws -d78d5cf1aaterminal: adjust marks when deleting scrollback lines (#36294) -f3f6705075terminal: avoid events messing up topline of focused terminal -8c5bc4920aterminal: avoid tailed cursor in focused terminal in events -934d28558dterminal: check size when creating new tabpage -e67fec1541terminal: deleting from wrong buffer (#36289) -e4db5edb8aterminal: don't trigger TextChangedT for unrelated redraws -854b319060terminal: handle OSC 8 split into multiple fragments -a6d8f40b64terminal: keep last cursor if it's on the last row -46d68e5290terminal: patch various autocommand-related holes -5ee9e3f258terminal: possibly wrong wrow/wcol in active terminal -b21ec366b9terminal: remove condition that buf is curbuf (#33721) -2eea65fe68terminal: update winopts and focus when switching terminals -169dc60a44terminal: wrong row in TermRequest with full scrollback (#36298) -8f05fdbfb3tests: ignore vector math types -924a8e4238tui: don't wait for DA1 response when stdin is closed (#35745) -07184aa973tui: handle sequence larger than entire buffer -1c8805e3b2vim.json: fix truncation of decoded numbers outside lua_Integer's range #35702 -8c311386c3window: don't add a hsep when out of room if global stl is off VIM PATCHES -------------------------------------------------------------------------------- -dd79bc8360014c731: runtime(doc): make :h virtcol() more accurate (#35976) -c2a3838ab28.1.0636: line2byte() gives wrong values with text properties -a0dac399d08.1.1681: insert stray "{" when listener gets buffer line -d573ffcfc78.1.1700: listener callback called for the wrong buffer -7159a0192b8.1.1711: listener callback called at the wrong moment -b6dd8bbca08.1.2008: error for invalid range when using listener and undo -03f9df81178.2.0115: byte2line() does not work correctly with text properties -d1a0d0889b8.2.0844: text properties crossing lines not handled correctly -9b5545103e8.2.0853: ml_delete() often called with FALSE argument -c8912d73298.2.3348: line2byte() returns wrong value after adding textprop -b0ed4a3cb88.2.3795: too many #ifdefs -e4bbe09dcc8.2.4379: an empty change is reported to a listener -5c6ea43da880981e1: runtime(doc): mention 'findfunc' at :h :find (#35697) -8634a461659.1.0689: [security]: buffer-overflow in do_search() with 'rightleft' -a839200c0a9.1.0695: tests: test_crash leaves Untitled file around -61aab4cfe09.1.0698: tests: "Untitled" file not removed when running Test_crash1_3 alone -85e4503f189.1.1754: :helptags doesn't skip examples with syntax -77fe01f2009.1.1773: Crash in BufLeave after BufUnload closes other windows (#35830) -7e724dfa2f9.1.1780: mbyte contains overlapping list of utf_classes table (#35869) -4db62d96bc9.1.1798: Wrong display with 'sms' and long wrapped virt text at EOL (#35930) -9c099830689.1.1802: 'nowrap' in a modeline may hide malicious code (#35946) -67688ab6169.1.1807: :set doesn't clear local insecure flag like :setlocal does -6dda8e95729.1.1808: Option insecure flags not copied when splitting window -ac48d9c3c99.1.1823: diff: w_topline may be invalidated (#36018) -e1fe0ed2df9.1.1831: stray vseps in right-most 'winfixwidth' window -d21c23b8c99.1.1836: 'culopt' "screenline" not redrawn with line("w0") and :retab -aab8134f879.1.1839: Window may have wrong height if resized from another tabpage (#36093) -ad172eb7629.1.1858: v:register not reset after Visual mode command (#36215) -a4319015ee9.1.1868: v:register is wrong in v_: command (#36238) -8928ede8af9.1.1870: :Tutor may not work as expected (#36343) -1b27d8f4289.1.1871: Wrong 'showcmd' in the cmdwin (#36320) -a2d4a0fda99.1.1885: Wrong restored cursor pos when re-entering buffer after changes -7790dca2eb9.1.1891: g<End> does not move to last non-blank in visual mode (#36354) -88ff561dcc9.1.1893: ICCF charity will dissolve (#36427) -19d58cb2cca0f37db: runtime(doc): use a single pattern in :h 'incsearch' example (#35721) -8ed1ef1377partial:9.0.0323: using common name in tests leads to flaky tests CI -------------------------------------------------------------------------------- -e415fae42eWindows arm64 packages #35345
358 lines
12 KiB
CMake
358 lines
12 KiB
CMake
# CMAKE REFERENCE
|
|
# - intro: https://codingnest.com/basic-cmake/
|
|
# - best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
|
|
# - pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
|
|
# - troubleshooting:
|
|
# - variable_watch https://cmake.org/cmake/help/latest/command/variable_watch.html
|
|
# - verbose output: cmake --build build --verbose
|
|
|
|
# Version should match the tested CMAKE_URL in .github/workflows/build.yml.
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(nvim C)
|
|
|
|
if(POLICY CMP0135)
|
|
cmake_policy(SET CMP0135 NEW)
|
|
endif()
|
|
|
|
if(XCODE)
|
|
message(FATAL_ERROR [[Xcode generator is not supported. Use "Ninja" or "Unix Makefiles" instead]])
|
|
endif()
|
|
|
|
# Point CMake at any custom modules we may ship
|
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
|
|
|
include(CheckCCompilerFlag)
|
|
include(CheckCSourceCompiles)
|
|
include(CheckLibraryExists)
|
|
include(ExternalProject)
|
|
include(FindPackageHandleStandardArgs)
|
|
include(GNUInstallDirs)
|
|
|
|
include(Deps)
|
|
include(Find)
|
|
include(InstallHelpers)
|
|
include(PreventInTreeBuilds)
|
|
include(Util)
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# User settings
|
|
#-------------------------------------------------------------------------------
|
|
|
|
set(DEPS_IGNORE_SHA FALSE)
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Variables
|
|
#-------------------------------------------------------------------------------
|
|
set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack)
|
|
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
|
|
set(VTERM_TEST_FILE ${PROJECT_BINARY_DIR}/test/vterm_test_output)
|
|
|
|
file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
|
|
|
if(NOT CI_BUILD)
|
|
set(CMAKE_INSTALL_MESSAGE NEVER)
|
|
endif()
|
|
|
|
if(${CMAKE_VERSION} VERSION_LESS 3.20)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
endif()
|
|
|
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.26)
|
|
set(COPY_DIRECTORY copy_directory_if_different)
|
|
else()
|
|
set(COPY_DIRECTORY copy_directory)
|
|
endif()
|
|
|
|
# Prefer our bundled versions of dependencies.
|
|
if(DEFINED ENV{DEPS_BUILD_DIR})
|
|
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/usr" CACHE PATH "Path prefix for finding dependencies")
|
|
else()
|
|
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
|
|
# When running from within CLion or Visual Studio,
|
|
# build bundled dependencies automatically.
|
|
if(NOT EXISTS ${DEPS_PREFIX}
|
|
AND (DEFINED ENV{CLION_IDE}
|
|
OR DEFINED ENV{VisualStudioEdition}))
|
|
message(STATUS "Building dependencies...")
|
|
set(DEPS_BUILD_DIR ${PROJECT_BINARY_DIR}/.deps)
|
|
file(MAKE_DIRECTORY ${DEPS_BUILD_DIR})
|
|
execute_process(
|
|
COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR}
|
|
-D CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
|
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
|
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
|
-D CMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
|
-D CMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
|
|
-D CMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL}
|
|
-D CMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
|
|
-D CMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
|
|
-D CMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
|
${PROJECT_SOURCE_DIR}/cmake.deps
|
|
WORKING_DIRECTORY ${DEPS_BUILD_DIR})
|
|
execute_process(
|
|
COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}
|
|
--config ${CMAKE_BUILD_TYPE})
|
|
set(DEPS_PREFIX ${DEPS_BUILD_DIR}/usr)
|
|
endif()
|
|
endif()
|
|
|
|
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
|
|
|
if(APPLE)
|
|
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
|
|
# fall back to local system version. Needs to be done both here and in cmake.deps.
|
|
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
execute_process(COMMAND sw_vers -productVersion
|
|
OUTPUT_VARIABLE MACOS_VERSION
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
|
|
endif()
|
|
message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
|
endif()
|
|
|
|
if(WIN32 OR APPLE)
|
|
# Handle case-insensitive filenames for Windows and Mac.
|
|
set(CASE_INSENSITIVE_FILENAME TRUE)
|
|
endif()
|
|
|
|
if (MINGW)
|
|
# Disable LTO by default as it may not compile
|
|
# See https://github.com/Alexpux/MINGW-packages/issues/3516
|
|
# and https://github.com/neovim/neovim/pull/8654#issuecomment-402316672
|
|
option(ENABLE_LTO "enable link time optimization" OFF)
|
|
else()
|
|
option(ENABLE_LTO "enable link time optimization" ON)
|
|
endif()
|
|
option(ENABLE_LIBINTL "enable libintl" ON)
|
|
option(ENABLE_WASMTIME "enable wasmtime" OFF)
|
|
|
|
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
|
|
|
set_default_buildtype(Debug)
|
|
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
|
if(NOT isMultiConfig)
|
|
# Unlike build dependencies in cmake.deps, we want dev dependencies such as
|
|
# Uncrustify to always be built with Release.
|
|
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=Release)
|
|
endif()
|
|
|
|
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
|
# version string, else they are combined with the result of `git describe`.
|
|
set(NVIM_VERSION_MAJOR 0)
|
|
set(NVIM_VERSION_MINOR 11)
|
|
set(NVIM_VERSION_PATCH 5)
|
|
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
|
|
|
# API level
|
|
set(NVIM_API_LEVEL 13) # Bump this after any API/stdlib change.
|
|
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
|
set(NVIM_API_PRERELEASE false)
|
|
|
|
# We _want_ assertions in RelWithDebInfo build-type.
|
|
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
|
|
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
|
string(REPLACE "/DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
|
string(REPLACE " " " " CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") # Remove duplicate whitespace
|
|
endif()
|
|
|
|
option(ENABLE_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
|
|
option(ENABLE_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
|
|
# TSAN exists to test Luv threads.
|
|
option(ENABLE_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
|
|
|
|
if((ENABLE_ASAN_UBSAN AND ENABLE_MSAN)
|
|
OR (ENABLE_ASAN_UBSAN AND ENABLE_TSAN)
|
|
OR (ENABLE_MSAN AND ENABLE_TSAN))
|
|
message(FATAL_ERROR "Sanitizers cannot be enabled simultaneously")
|
|
endif()
|
|
|
|
# Place targets in bin/ or lib/ for all build configurations
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES})
|
|
string(TOUPPER ${CFGNAME} CFGNAME)
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/bin)
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
|
|
endforeach()
|
|
|
|
if(NOT PREFER_LUA)
|
|
find_program(LUA_PRG NAMES luajit)
|
|
endif()
|
|
find_program(LUA_PRG NAMES lua5.1 lua5.2 lua)
|
|
mark_as_advanced(LUA_PRG)
|
|
if(NOT LUA_PRG)
|
|
message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter")
|
|
endif()
|
|
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
|
|
|
# Some of the code generation still relies on stable table ordering in order to
|
|
# produce reproducible output - specifically the msgpack'ed data in
|
|
# funcs_metadata.generated.h and ui_events_metadata.generated.h. This should
|
|
# ideally be fixed in the generators, but until then as a workaround you may provide
|
|
# a specific lua implementation that provides the needed stability by setting LUA_GEN_PRG:
|
|
if(NOT LUA_GEN_PRG)
|
|
set(LUA_GEN_PRG "${LUA_PRG}" CACHE FILEPATH "Path to the lua used for code generation.")
|
|
endif()
|
|
mark_as_advanced(LUA_GEN_PRG)
|
|
message(STATUS "Using Lua interpreter for code generation: ${LUA_GEN_PRG}")
|
|
|
|
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
|
|
if(COMPILE_LUA AND NOT WIN32)
|
|
if(PREFER_LUA)
|
|
foreach(CURRENT_LUAC_PRG luac5.1 luac)
|
|
find_program(_CHECK_LUAC_PRG ${CURRENT_LUAC_PRG})
|
|
if(_CHECK_LUAC_PRG)
|
|
set(LUAC_PRG "${_CHECK_LUAC_PRG} -s -o - %s" CACHE STRING "Format for compiling to Lua bytecode")
|
|
break()
|
|
endif()
|
|
endforeach()
|
|
elseif(LUA_PRG MATCHES "luajit")
|
|
check_lua_module(${LUA_PRG} "jit.bcsave" LUAJIT_HAS_JIT_BCSAVE)
|
|
if(LUAJIT_HAS_JIT_BCSAVE)
|
|
set(LUAC_PRG "${LUA_PRG} -b -s %s -" CACHE STRING "Format for compiling to Lua bytecode")
|
|
endif()
|
|
endif()
|
|
endif()
|
|
mark_as_advanced(LUAC_PRG)
|
|
if(LUAC_PRG)
|
|
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
|
|
endif()
|
|
|
|
# Lint
|
|
option(CI_LINT "Abort if lint programs not found" OFF)
|
|
if(CI_LINT)
|
|
set(LINT_REQUIRED "REQUIRED")
|
|
endif()
|
|
find_program(SHELLCHECK_PRG shellcheck ${LINT_REQUIRED})
|
|
mark_as_advanced(SHELLCHECK_PRG)
|
|
find_program(STYLUA_PRG stylua ${LINT_REQUIRED})
|
|
mark_as_advanced(STYLUA_PRG)
|
|
|
|
set(STYLUA_DIRS runtime scripts src test contrib)
|
|
|
|
add_glob_target(
|
|
TARGET lintlua-luacheck
|
|
COMMAND $<TARGET_FILE:nvim_bin>
|
|
FLAGS -ll ${PROJECT_SOURCE_DIR}/test/lua_runner.lua ${CMAKE_BINARY_DIR}/usr luacheck -q
|
|
GLOB_DIRS runtime scripts src test
|
|
GLOB_PAT *.lua
|
|
TOUCH_STRATEGY PER_DIR)
|
|
add_dependencies(lintlua-luacheck lua_dev_deps)
|
|
|
|
add_glob_target(
|
|
TARGET lintlua-stylua
|
|
COMMAND ${STYLUA_PRG}
|
|
FLAGS --color=always --check --respect-ignores
|
|
GLOB_DIRS ${STYLUA_DIRS}
|
|
GLOB_PAT *.lua
|
|
TOUCH_STRATEGY PER_DIR)
|
|
|
|
add_custom_target(lintlua)
|
|
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
|
|
|
|
add_glob_target(
|
|
TARGET lintsh
|
|
COMMAND ${SHELLCHECK_PRG}
|
|
FLAGS -x -a
|
|
GLOB_DIRS scripts
|
|
GLOB_PAT *.sh
|
|
TOUCH_STRATEGY PER_DIR)
|
|
|
|
add_custom_target(lintcommit
|
|
COMMAND $<TARGET_FILE:nvim_bin> -u NONE -l ${PROJECT_SOURCE_DIR}/scripts/lintcommit.lua main)
|
|
add_dependencies(lintcommit nvim_bin)
|
|
|
|
add_custom_target(lint)
|
|
add_dependencies(lint lintc lintlua lintsh)
|
|
|
|
# Format
|
|
add_glob_target(
|
|
TARGET formatlua
|
|
COMMAND ${STYLUA_PRG}
|
|
FLAGS --respect-ignores
|
|
GLOB_DIRS ${STYLUA_DIRS}
|
|
GLOB_PAT *.lua
|
|
TOUCH_STRATEGY PER_DIR)
|
|
|
|
add_custom_target(format)
|
|
add_dependencies(format formatc formatlua)
|
|
|
|
install_helper(
|
|
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1
|
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
|
|
|
add_custom_target(nvim ALL)
|
|
add_dependencies(nvim nvim_bin nvim_runtime_deps nvim_runtime)
|
|
|
|
add_subdirectory(src/nvim)
|
|
add_subdirectory(cmake.config)
|
|
add_subdirectory(runtime)
|
|
add_subdirectory(test)
|
|
|
|
add_custom_target(uninstall
|
|
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
|
|
|
|
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
|
add_subdirectory(cmake.packaging)
|
|
endif()
|
|
|
|
get_externalproject_options(uncrustify ${DEPS_IGNORE_SHA})
|
|
ExternalProject_Add(uncrustify
|
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/uncrustify
|
|
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
|
-D CMAKE_RUNTIME_OUTPUT_DIRECTORY=${DEPS_BIN_DIR}
|
|
-D CMAKE_SKIP_RPATH=true
|
|
EXCLUDE_FROM_ALL TRUE
|
|
${EXTERNALPROJECT_OPTIONS})
|
|
|
|
option(USE_BUNDLED_BUSTED "Use bundled busted" ON)
|
|
if(USE_BUNDLED_BUSTED)
|
|
get_externalproject_options(lua_dev_deps ${DEPS_IGNORE_SHA})
|
|
ExternalProject_Add(lua_dev_deps
|
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/lua_dev_deps
|
|
SOURCE_DIR ${DEPS_SHARE_DIR}
|
|
CONFIGURE_COMMAND ""
|
|
BUILD_COMMAND ""
|
|
INSTALL_COMMAND ""
|
|
EXCLUDE_FROM_ALL TRUE
|
|
${EXTERNALPROJECT_OPTIONS})
|
|
else()
|
|
add_custom_target(lua_dev_deps)
|
|
endif()
|
|
|
|
if (CMAKE_SYSTEM_PROCESSOR MATCHES arm64)
|
|
set(LUALS_ARCH arm64)
|
|
else()
|
|
set(LUALS_ARCH x64)
|
|
endif()
|
|
|
|
set(LUALS_VERSION 3.13.9)
|
|
set(LUALS "lua-language-server-${LUALS_VERSION}-${CMAKE_SYSTEM_NAME}-${LUALS_ARCH}")
|
|
set(LUALS_TARBALL ${LUALS}.tar.gz)
|
|
set(LUALS_URL https://github.com/LuaLS/lua-language-server/releases/download/${LUALS_VERSION}/${LUALS_TARBALL})
|
|
|
|
ExternalProject_Add(download_luals
|
|
URL ${LUALS_URL}
|
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luals
|
|
SOURCE_DIR ${DEPS_BIN_DIR}/luals
|
|
CONFIGURE_COMMAND ""
|
|
BUILD_COMMAND ""
|
|
INSTALL_COMMAND ""
|
|
EXCLUDE_FROM_ALL TRUE
|
|
DOWNLOAD_NO_PROGRESS TRUE
|
|
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
|
|
|
file(GLOB_RECURSE LUAFILES runtime/*.lua)
|
|
add_target(luals
|
|
COMMAND ${DEPS_BIN_DIR}/luals/bin/lua-language-server
|
|
--configpath=${PROJECT_SOURCE_DIR}/.luarc.json
|
|
--check=${PROJECT_SOURCE_DIR}/runtime
|
|
--checklevel=Hint
|
|
DEPENDS ${LUAFILES}
|
|
CUSTOM_COMMAND_ARGS USES_TERMINAL)
|
|
|
|
add_dependencies(luals download_luals)
|