2017-12-27 11:30:23 -07:00
|
|
|
# CMAKE REFERENCE
|
|
|
|
# intro: https://codingnest.com/basic-cmake/
|
|
|
|
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
|
2022-10-09 05:21:52 -07:00
|
|
|
# pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
|
2017-12-27 11:30:23 -07:00
|
|
|
|
2021-10-19 19:19:33 -07:00
|
|
|
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
|
|
|
|
cmake_minimum_required(VERSION 3.10)
|
2018-06-15 05:33:07 -07:00
|
|
|
project(nvim C)
|
2014-01-31 06:39:15 -07:00
|
|
|
|
2022-03-03 04:20:21 -07:00
|
|
|
if(POLICY CMP0075)
|
|
|
|
cmake_policy(SET CMP0075 NEW)
|
|
|
|
endif()
|
2019-10-01 18:44:57 -07:00
|
|
|
|
2014-02-24 13:54:45 -07:00
|
|
|
# Point CMake at any custom modules we may ship
|
2014-11-10 17:26:01 -07:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
2014-02-24 13:54:45 -07:00
|
|
|
|
2016-10-11 15:35:02 -07:00
|
|
|
# We don't support building in-tree.
|
|
|
|
include(PreventInTreeBuilds)
|
2022-06-30 05:10:05 -07:00
|
|
|
include(Util)
|
|
|
|
|
|
|
|
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
|
2016-10-11 15:35:02 -07:00
|
|
|
|
2018-06-17 05:54:39 -07:00
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
|
2014-03-03 08:09:06 -07:00
|
|
|
# Prefer our bundled versions of dependencies.
|
2018-03-11 05:15:42 -07:00
|
|
|
if(DEFINED ENV{DEPS_BUILD_DIR})
|
2021-06-13 11:03:47 -07:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
|
|
|
# pkg-config 29.2 has a bug on OpenBSD which causes it to drop any paths that
|
|
|
|
# *contain* system include paths. To avoid this, we prefix what would be
|
|
|
|
# "/usr/include" as "/_usr/include".
|
2022-06-27 03:08:59 -07:00
|
|
|
# This check is also performed in the cmake.deps/CMakeLists.txt and in the
|
2021-06-13 11:03:47 -07:00
|
|
|
# else clause following here.
|
|
|
|
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
|
|
|
|
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/_usr" CACHE PATH "Path prefix for finding dependencies")
|
|
|
|
else()
|
|
|
|
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/usr" CACHE PATH "Path prefix for finding dependencies")
|
|
|
|
endif()
|
2018-03-11 05:15:42 -07:00
|
|
|
else()
|
2021-06-13 11:03:47 -07:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
|
|
|
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/_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")
|
|
|
|
endif()
|
2018-06-10 07:57:12 -07:00
|
|
|
# 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}
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
|
|
|
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
|
|
|
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
|
|
|
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
|
|
|
-DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
|
|
|
|
-DCMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL}
|
|
|
|
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
|
|
|
|
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
|
|
|
|
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
|
2022-06-27 03:08:59 -07:00
|
|
|
${PROJECT_SOURCE_DIR}/cmake.deps
|
2018-06-10 07:57:12 -07:00
|
|
|
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()
|
2018-03-11 05:15:42 -07:00
|
|
|
endif()
|
2018-06-10 07:57:12 -07:00
|
|
|
|
2022-06-12 15:11:14 -07:00
|
|
|
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
|
|
|
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
|
2014-03-03 08:09:06 -07:00
|
|
|
|
2015-08-27 00:56:46 -07:00
|
|
|
# used for check_c_compiler_flag
|
|
|
|
include(CheckCCompilerFlag)
|
|
|
|
|
2014-11-08 14:16:39 -07:00
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
|
# CMake tries to treat /sw and /opt/local as extension of the system path, but
|
|
|
|
# that doesn't really work out very well. Once you have a dependency that
|
|
|
|
# resides there and have to add it as an include directory, then any other
|
|
|
|
# dependency that could be satisfied from there must be--otherwise you can end
|
|
|
|
# up with conflicting versions. So, let's make them more of a priority having
|
|
|
|
# them be included as one of the first places to look for dependencies.
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH /sw /opt/local)
|
|
|
|
|
2022-07-19 07:10:59 -07:00
|
|
|
# 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("Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
|
|
|
|
2014-11-08 14:16:39 -07:00
|
|
|
# Work around some old, broken detection by CMake for knowing when to use the
|
|
|
|
# isystem flag. Apple's compilers have supported this for quite some time
|
|
|
|
# now.
|
2022-08-26 05:30:55 -07:00
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
2014-11-08 14:16:39 -07:00
|
|
|
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
|
|
|
|
endif()
|
2017-01-17 08:32:41 -07:00
|
|
|
endif()
|
2015-03-26 20:30:45 -07:00
|
|
|
|
2017-01-17 08:32:41 -07:00
|
|
|
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
2021-02-23 21:54:12 -07:00
|
|
|
# Ignore case when comparing filenames on Windows and Mac.
|
|
|
|
set(CASE_INSENSITIVE_FILENAME TRUE)
|
2017-01-17 08:32:41 -07:00
|
|
|
# Enable fixing case-insensitive filenames for Windows and Mac.
|
2015-03-26 20:30:45 -07:00
|
|
|
set(USE_FNAME_CASE TRUE)
|
2014-11-08 14:16:39 -07:00
|
|
|
endif()
|
|
|
|
|
2018-06-01 11:17:24 -07:00
|
|
|
option(ENABLE_LIBINTL "enable libintl" ON)
|
2018-06-06 18:39:17 -07:00
|
|
|
option(ENABLE_LIBICONV "enable libiconv" ON)
|
2022-05-17 06:08:24 -07:00
|
|
|
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()
|
2018-06-01 11:17:24 -07:00
|
|
|
|
2019-02-15 13:18:16 -07:00
|
|
|
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
|
|
|
|
2022-09-06 07:52:39 -07:00
|
|
|
set_default_buildtype()
|
2019-02-15 13:18:16 -07:00
|
|
|
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
|
|
|
set(DEBUG 1)
|
|
|
|
else()
|
|
|
|
set(DEBUG 0)
|
2014-11-09 05:52:15 -07:00
|
|
|
endif()
|
2015-12-19 20:58:47 -07:00
|
|
|
|
2015-12-13 10:29:02 -07:00
|
|
|
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
2016-10-26 06:20:00 -07:00
|
|
|
# version string, else they are combined with the result of `git describe`.
|
2014-10-04 15:32:47 -07:00
|
|
|
set(NVIM_VERSION_MAJOR 0)
|
2022-09-30 08:26:25 -07:00
|
|
|
set(NVIM_VERSION_MINOR 9)
|
2018-12-30 16:44:49 -07:00
|
|
|
set(NVIM_VERSION_PATCH 0)
|
2022-09-30 08:26:25 -07:00
|
|
|
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
|
2015-09-28 03:17:19 -07:00
|
|
|
|
2016-10-26 06:20:00 -07:00
|
|
|
# API level
|
2022-04-23 03:04:38 -07:00
|
|
|
set(NVIM_API_LEVEL 10) # Bump this after any API change.
|
2016-10-26 06:20:00 -07:00
|
|
|
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
NVIM v0.8.0
BREAKING CHANGES
- Remove 'insertmode' 'remap' and 'terse' options
- highlight: Rename attributes to match Vim (#19159)
- highlight: Error on invalid names and allow '.' and '@'
- terminal: Drop winpty, require Windows 10 #18253
- treesitter: Use @foo.bar style highlight groups
- treesitter: Do not merge queries by default (#20105)
FEATURES
- runtime: Enable filetype.lua by default (#19216)
- Add `undo!`
- Add "prerelease" to version dict
- Click support for 'statusline', 'winbar' #18650
- Add preview functionality to user commands
- allow cmdheight=0 (EXPERIMENTAL) #16251
- Stdpath('run'), /tmp/nvim.user/ #18993
- Add 'mousescroll' option (#12355)
- Allow :wincmd to accept a count (#19815)
- Multibuffer preview support for inccommand
- Man: Port to Lua (#19912)
- api: Ui options relevant for remote TUI
- api: Add `nvim_parse_cmd` And `nvim_cmd`
- api: Support handling stdin stream in remote ui
- api: Add `group_name` to `nvim_get_autocmds`
- api: Enable nvim_exec_autocmds to pass arbitrary data (#18613)
- api: Support pattern array for exec_autocmds
- api: Add `unsilent` to command APIs
- api: Add replace_keycodes to nvim_set_keymap (#19598)
- api: Add support for :horizontal modifier
- api: Add "move" to nvim_input_mouse
- api/ui: "ui_watched" option for ui-side extmarks
- build: Add_glob_target runs only on changed files #19070
- checkhealth: Check for slow shell #17829
- defaults: Session data in $XDG_STATE_HOME #15583
- defaults: Search selection by * and # in visual mode (#18538)
- defaults: Nnoremap & :&&<CR> #19365
- defaults: enable mouse by default (set mouse=nvi) #19290
- diagnostic: Pass diagnostics as data to DiagnosticChanged autocmd (#20173)
- docs: Gen_help_html.lua
- edit: Insert an unsimplified key using CTRL-SHIFT-V
- treesitter: Full support for spelling
- filetype: Convert more patterns to filetype.lua
- filetype: Remove side effects from vim.filetype.match (#18894)
- filetype: Expand environment variables in filetype patterns (#20145)
- fs: Add vim.fs functions: parents() dirname() basename() dir() find() normalize()
- highlight: Implement CurSearch highlight
- highlight: Support scoped @spam.eggs.baked_beans groups
- input: Delay all simplifications
- l10n: Turkish translations #19441
- l10n: Improve zh_CN translations (#19483)
- lsp: Remove capabilities sanitization (#17814)
- lsp: Show feedback on empty hover response (#18308)
- lsp: Options to filter and auto-apply code actions (#18221)
- lsp: Add vim.lsp.buf.format (#18193)
- lsp: Add logging level "OFF" (#18379)
- lsp: Add LspAttach and LspDetach autocommands
- lsp: Add filter to vim.lsp.get_active_clients()
- lsp: Option to reuse_win for jump actions (#18577)
- lsp: Add a start function (#18631)
- lsp: Send didChangeConfiguration after init (#18847)
- lsp: Defaults: tagfunc, omnifunc, formatexpr (#19003, #19677)
- lsp: Allow passing custom list handler to LSP functions that return lists (#19213)
- lsp: Provide feedback if server can't compute rename result (#19546)
- lsp: Add range option to code_action; deprecate range_code_action (#19551)
- lsp: Disable exit_timeout by default (#19672)
- lsp: Add tcp support
- lua: Vim.deprecate() #18320
- lua: Vim.cmd() with kwargs acts like nvim_cmd() #18523
- lua: Allow some vim script functions to run in fast callbacks
- lua: Measure require in --startuptime
- lua: Allow vim.cmd to be indexed (#19238)
- lua: Print source locations of lua callbacks (#19597)
- lua: Add vim.iconv (#18286)
- lua: Vim.ui_attach to get ui events from lua (EXPERIMENTAL)
- man.vim: List command flags in "gO" outline #17558
- mappings: Do not replace existing mapping for simplified form
- mappings: Allow special keys and modifiers in <Cmd> mapping
- mapset: Support restoring "replace_keycodes" and "desc"
- mapset: Support restoring Lua callback (#20024)
- marks: Restore viewport on jump #15831
- nvim_create_user_command: Pass structured modifiers to commands
- pum: Pretend 'mousemoveevent' is set when showing right-click menu
- server: Set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009
- server: Instance "name", store pipes in stdpath(state)
- term: Add support for libvterm >= 0.2
- terminal: Implement <c-\><c-o> for terminal mode
- terminal: Recognize underdouble and undercurl
- terminfo: Bump built-in terminfo entries (#18570)
- treesitter: Allow customizing language symbol name
- treesitter: Add ability to retreive a tree/node given a range
- treesitter: Upstream node methods from nvim-treesitter
- treesitter: Include language in invalid query error (#14053)
- treesitter: Bundle Lua parser and queries
- treesitter: Add viml parser and queries
- treesitter: Add injections
- treesitter: Add vim.treesitter.start(), enable for Lua
- treesitter: Bundle :help parser and queries
- tui: Query terminal for CSI u support (#18181)
- tui: Recognize keypad keys when using kitty keyboard protocol
- tui: Try terminfo for [re]set_cursor_color OSC #19255
- tui: Allow grid and host to disagree on ambiguous-width chars (#19686)
- tui: Recognize sidescroll events (#19992)
- tui: Support 'mousemoveevent'
- ui: Add `'winbar'`
- ui: Clear message history explicitly with msg_history_clear event
- ui: Make right-click menu work properly with ext_multigrid
- ui: Allow to set the highlight namespace per window
- ui: Use msg_grid based implementation for cmdheight=0
- ui-ext: Make 'mousemoveevent' a ui_option
- eval: Make Lua Funcref work as method and in substitute() (#20217)
- eval: Input() support any type for "cancelreturn" in a dict (#19357)
BUG FIXES
- Show autocmd output when F is in shortmess (#18251)
- Has() should preserve v:shell_error #18280
- Suppress "is a directory" messages with shortmess 'F' (#18296)
- Display global statusline correctly with ext_messages
- Correct nlua_wait error message #18867
- Right-click in clickable statusline #19252
- Remote UI may get invalid 'pumblend' value #19379
- Assertion failure when requiring missing module in autocmd
- api: Nvim_eval_statusline should validate input #18347
- api: Check error after getting win/buf handle (#19052)
- api: Check for inclusive buffer line index out of bounds correctly (#19056)
- api: Change default value of 'pattern' in nvim_exec_autocmds (#19115)
- api: Do not switch win/buf if getting option in current win/buf (#19383)
- api: Make nvim_set_hl(ns=0, ...) redraw screen properly
- api: Nvim_set_hl bail out on invalid group name (#20021)
- api: Notify dict watchers on nvim_set_var and vim.g setter
- api/command: Fargs behavior when no arguments are passed (#19862)
- autocmds: Separate command from desc (#18617)
- buffer: Disable buffer-updates before removing from window #18933
- build: Missing definitions for sizeof macros #16393
- build: Only pass -municode if MINGW #19049
- build: Strip trailing newline from variable (#19084)
- build: Don't disable byte precompilation on debug builds
- build: Fails if git is missing #19366
- charclass: Make behavior with empty str match latest Vim (#19749)
- checkhealth: Skip vim.health #18816
- ci: Remove 2000ms blocking wait in many plugin/lsp_spec.lua tests
- cmd: Make :-tabmove work with modifiers (#18447)
- cmdheight=0: Various issues part3 #19816
- cmdline: Fix passing -1 as char
- cmdline: Trigger CmdlineEnter and ModeChanged earlier (#19474)
- cmdline: Do not trigger completion at wrong time (#19920)
- cmdline: Don't send invalid cursor with incsearch and cmdheight=0
- column: Move sign sentinel after inserting/deleting lines (#20400)
- completion: Remove wrong FUNC_ATTR_NONNULL_ALL (#19627)
- diagnostic: Use nvim_exec_autocmds to trigger DiagnosticChanged (#18188)
- diagnostic: Check for negative column value (#18868)
- diagnostic: Remove buf from cache on `BufWipeout` (#20099)
- diagnostic: Populate data key in DiagnosticChanged autocmd in reset (#20207)
- docs: Correct obsolete note about 'writedelay' in dev docs
- docs: Remove internal function from docs
- edit.c: Indentkeys double indent after "!" #12894
- eval: Check for v:lua when calling callback (#19855)
- eval/f_getmatches: Return empty list for invalid win argument (#18893)
- events: Make CursorHold behave as documented
- ex_cmds: Correct flags for :const (#19387)
- exceptions: Restore `did_throw` (#20000)
- exmode: Do not throttle messages when pressing enter to print line
- extmarks: Make virt_lines always start at 0 virtcol
- filetype: Fix and improve filetype patterns
- fillchars: Change fallback after setcellwidths()
- float: Make `screen*()` functions respect floating windows
- float: Fix glitch when making float window with border a split
- float: Fix mouse drag position if float window turned to a split
- folds: Fix fold regression with :move (#18685)
- folds: Fix fold remains when :delete makes buffer empty (#19673)
- ftdetect: Source plugins in autogroup (#18237)
- gen_vimdoc.py: Handle missing luajit
- getchar: Flush screen before doing a blocking wait
- handlers: More specific error messages (#16772)
- health: Correct shada file path #18603
- health: Handle non-existent log file #18610
- highlight: Use ctermbg/fg instead of bg/fg when use_rgb=false #18982
- highlight: Add missing 'nocombine' to nvim_get_hl apis (#19586)
- highlight: Set the window namespace when redrawing statusline
- hl: Set Normal hl group sg_attr value #18820
- hl: Return cterm fg/bg even if they match Normal #18981
- inccommand: Do not try to preview an ambiguous command (#18827)
- inccommand: Avoid crash if callback changes inccommand option (#18830)
- inccommand: Clear cmdpreview state if preview is not shown (#18923)
- inccommand: Skip split window if not enough room #18937
- inccommand: Never preview if parsing command failed (#18944)
- inccommand: Parse the command to check if it is previewable
- inccommand: Deal with unsynced undo (#20041)
- input: Allow Ctrl-C to interrupt a recursive mapping even if mapped (#18885)
- input: Fix macro recording with ALT and special key (#18917)
- input: Use correct grid when restoring cursor for <expr> mapping (#19047)
- input: Do no reinterpret mouse keys with ALT modifiers
- input: Use click number of last click for mouse drag (#20300)
- inspect: Escape identifiers that are lua keywords (#19898)
- keywordprg: Default to :help if set to empty string (#19983)
- l10n: Improve zh_CN and zh_TW translations (#19969)
- log: Back even again
- logging: Skip recursion, fix crash #18764
- logging: Make logmsg() thread-safe again
- logging: Try harder to resolve Nvim "name" #19016
- lsp: Unify progress message handling (#18040)
- lsp: Fix unnecessary buffers being added on empty diagnostics (#18275)
- lsp: Fix infinite loop in resolved_capabilities deprecation message (#18333)
- lsp: Add missing bufnr argument (#18382)
- lsp: Fix rename capability checks and multi client support (#18441)
- lsp: Detach spawned LSP server processes (#18477)
- lsp: Perform client side filtering of code actions (#18392)
- lsp: Only send diagnostics from current buffer in code_action() (#18639)
- lsp: Respect global syntax setting in open float preview (#15225)
- lsp: Include cancellable in progress message table (#18809)
- lsp: Adjust offset encoding in lsp.buf.rename() (#18829)
- lsp: Set buflisted before switching to buffer (#18854)
- lsp: Fix multi client handling in code action (#18869)
- lsp: Small bugs in snippet-parser #18998
- lsp: Pcall nvim_del_augroup_by_name (#19302)
- lsp: Abort pending changes after flush when debouncing (#19314)
- lsp: Don't attach a client in lsp.start() if there is none (#19328)
- lsp: Account for initializing servers in vim.lsp.start (#19329)
- lsp: Move augroup define to if statement (#19406)
- lsp: Set workspace.configuration capability (#19548)
- lsp: Send didOpen if name changes on write (#19583)
- lsp: Prevent unexpected position jumps (#19370)
- lsp: Avoid ^M character in hover window on Windows (#19640)
- lsp: Set end_col in formatexpr (#19676)
- lsp: Handle multiple clients with incremental sync (#19658)
- lsp: Fix some type annotations in lsp.rpc (#19714)
- lsp: Avoid pipe leaks if lsp cmd isn't executable (#19717)
- lsp: Handle nil client in onexit callback (#19722)
- lsp: Fix nil value error in get_group (#19735)
- lsp: Clean the diagnostic cache when buffer delete (#19449)
- lsp: When buffer detach remove buffer from client attached buffers (#20081)
- lsp: Schedule removal of client object (#20148)
- lsp: Support `false` result in handlers (#20252)
- lsp: Out of bounds error in lsp.util.apply_text_edits (#20137)
- lsp: Use correct function name in deprecated message (#20308)
- lsp: Create missing directory before creating file (#19835)
- lua: Don't mutate opts parameter of vim.keymap.del (#18227)
- lua: Stop pending highlight.on_yank timer, if any (#18824)
- lua: Highlight.on_yank can close timer in twice #18976
- lua: Clear got_int when calling vim.on_key() callback (#18979)
- lua: Don't leak memory on error
- lua: Double entries in :lua completion #19410
- lua: Make it possible to cancel vim.wait() with Ctrl-C (#19217)
- lua: Make ui_attach()/ui_detach() take effect immediately (#20037)
- lua: Make vim.str_utfindex and vim.str_byteindex handle NUL bytes
- lua: Free vim.ui_attach callback before lua close (#20205)
- lua: Fix architecture-dependent behavior in usercmd "reg" (#20384)
- mac: Use same $LANG fallback mechanism as Vim
- mac: Add CoreServices to flake.nix #18358
- man.vim: Q in "$MANPAGER mode" does not quit #18443
- maparg: Remove double allocation (#20033)
- mappings: Fix double-free when unmapping simplifiable Lua mapping
- mapset: Remove existing abbreviation of same lhs (#20320)
- mark: Set mark fnum from buffer (#19195)
- mark: Mark without a view restores at topline #19224
- mark: Fix unexpected cursor movements (#19253)
- mark: Give correct error message when mark is in another buffer (#19454)
- menu: Make :menu still print header when there are no menus
- messages: Add color when showing nvim_echo in :messages history
- messages: Do not crash on cmdheight=0 and g< redisplay
- messages: Validate msg_grid before silent! message with cmdheight=0
- mksession: Don't store floats in session #18635
- mouse: Click on global statusline with splits (#19390)
- mouse: Fix using uninitialized memory with K_MOUSEMOVE (#19480)
- mpack: Make sure a `bool` always is a `bool`
- normal: Fix segfault with bracket command jumping to a mark
- options: Properly free string options (#19510)
- options: Mark `winhighlight` as list style (#19477)
- packaging: Remove excess forward slash in Wix Patch (#18121)
- paste: Ignore mappings in Cmdline mode (#18114)
- path: Path_is_url returns false for "foo:/" #19797
- powershell: Filter ":!" commands with args #19268
- pum: Make right drag in anchor grid to select work in multigrid UI (#19382)
- query: Fix unnatural order for inherits in treesitter queries (#20298)
- redraw: Make sure :redraw! redraws command line
- redraw: Handle switching to a tabpage with larger p_ch value
- redraw: Avoid unnecessary redraws and glitches with floats+messages
- redraw: Make redrawdebug=nodelta handle all the cases
- rpc: Break nvim_error_event feedback loop between two nvim instances
- runtime/genvimvim: Omit s[ubstitute] from vimCommand #18480
- screen: Restart win_update() if a decor provider changes signcols (#18768)
- screen: Check for col instead of vcol when drawing fold (#19572)
- session: Respect sessionoptions=terminal #19497
- shared: Avoid indexing unindexable values in vim.tbl_get() (#18337)
- signs: Priority of extmark signs (#19718)
- source: Make changing 'shellslash' change expand() result
- source: Fix expand('<sfile>') no longer works for Lua
- spell: Make setting 'encoding' clear word list
- spell: Correct spell move behavior without "noplainbuffer" (#20386)
- startup: Nvim with --clean should not load user rplugins
- substitute: Subtract number of backslashes later
- tabpage: Check if ROWS_AVAIL changed for resize (#19620)
- terminal: Invalid pointer comparison #18453
- terminal: Do not trim whitespace that is actually in the terminal (#16423)
- terminal: Scrollback delete lines immediately #18832
- terminal: Coverity USE_AFTER_FREE #18978
- terminal: Crash if TermClose deletes own buffer #19222
- terminal: Avoid reading over the end of cell.chars (#19580)
- terminal: Skip aucmd_win when checking terminal size (#19668)
- terminal: Adopt altscreen test for libvterm 0.2 changes
- terminfo: Disable smglr for vtpcon and conemu (#18855)
- termopen: Avoid ambiguity in URI when CWD is root dir (#16988)
- tests: Fix some screen.lua warnings
- tests: Fix some issues with ui/inccommand_spec.lua causing slowness
- tests: Unreliable parser_spec #18911
- tests: Check for EOF on exit of nvim properly
- tests: Missing clear() #18927
- tests: Remove misleading $TEST_PATH segment #19050
- tests: Remove irrelevant usage of display-=msgsep
- tests: Use pending_c_parser when needed
- tests: Indicate in test logs when nvim exit times out
- tmpdir: Invalid tempname() if username has slashes #19323
- treesitter: Create new parser if language is not the same as cached parser (#18149)
- treesitter: Bump match limit up
- treesitter: Offset directive associates range with capture (#18276)
- treesitter: Correct region for string parser (#18794)
- treesitter: New iter if folded
- treesitter: Don't error when node argument of predicate is nil (#19355)
- treesitter: Free memory on removing parser (#19933)
- treesitter: More efficient node:root()
- treesitter: Make it get_captures_at_position
- treesitter: Do not link @error by default
- treesitter: Don't support legacy syntax in start()
- treesitter: Use the right loading order for base queries (#20117)
- treesitter: Prevent endless loop on self-inheritence
- treesitter: Return full metadata for get_captures_at_position (#20203)
- ts: Do not clobber spelloptions (#20095)
- tui: Update modifyOtherKeys reporting (#18158)
- tui: Disable extended keys before exiting alternate screen (#18318)
- tui: Piping nodejs to nvim breaks input handling #18932
- tui: Resize at startup #17795
- tui: Add fixups for hterm family #19078
- tui: Handle padding requirements for visual bell (#20238)
- ui: Require window-local value to show winbar on floating windows (#18773)
- ui: Do not call showmode() when setting window height (#18969)
- ui: Set redraw_cmdline when setting window height (#19630)
- ui: Don't allow decor provider with ns_id==0
- ui: Ui compositor does not correctly free event callbacks
- ui: Allow redrawing statusline when msgsep is used (#20337)
- ui: Redraw end of buffer if last line is modified (#20354)
- unittests: Coredump when running unit tests #18663
- usercmd: Also check for whitespace after escaped character (#19942)
- version.c: Mark N/A vim patches #18587
- vim.ui.input: Accept nil or empty "opts" #19109
- window: Close floats first when closing buffer in other tab (#20284)
- window: Fix equalization with cmdheight=0 (#20369)
- windows: Stdpath("state") => "nvim-data" #18546
- windows: Exepath, stdpath return wrong slashes #19111
- winhl: Do not crash when unsetting winhl in just opened window
- Make :undo! notify buffer update callbacks (#20344)
- eval: Make Vim functions return inner window width and height (#19743)
BUILD SYSTEM
- Bump Doxyfile to minimum required version 1.9.0 #18118
- Bump msgpack to 4.0.0
- Enable EXITFREE on Debug builds (#17783)
- Add formatting targets for c and lua files (#19488)
- clang-format: Align with project style #18192
- clint: Remove all python2-isms with pyupgrade
- clint: Remove "function size is too large" warning
- clint: Remove rules for includes, whitespace, tabs #18611
- cmake: Simplify and speed up the uninstall target
- cmake: Simplify def_cmd_target function
- cmake: Use glob_wrapper instead of file(GLOB in main CMakeLists
- cmake: Fix static `libintl` test on macOS
- deps: Bump LuaJIT, Luv and libuv
- deps: Support universal builds on macOS
- deps: Bump tree-sitter to v0.20.7 (#20067)
- deps: Bump tree-sitter parsers
- deps: Bump required libvterm to v0.3 (#20222)
- deps: Require libtermkey version 0.22
- deps: update neovim-qt, win32tools.zip
PERFORMANCE
- Only redraw for CurSearch when it is currently in use
- highlight: Allocate permanent names in an arena for fun and cache locality
- highlight: Use binary search to lookup RGB color names
- map: Visit only one hash bucket instead of all, like an actual hash table
- memory: Get rid of extraneous heap allocations
- memory: implement arena memory allocation with a shared freelist
- memory: Use an arena for RPC decoding and some API return values
- messages: Don't call ui_flush() per message line in various places
- treesitter: Use a reuse list for query cursors
- ui: Reduce allocations when encoding and decoding "redraw" events
- ui: Avoid ui_flush() work in headless mode
REFACTOR
- checkhealth: Rename to vim.health, move logic to Lua #18720
- Add pure attribute to pure functions
- Replace char_u variables and functions with char
- Enable -Wconversion warning for all Nvim source files
- Add warnings for deprecated functions (#18662)
- Change type of linenr_T from long to int32_t
- Use nvim_get/set_option_value for vim.{b,w}o
- Remove functions marked for deprecation in 0.8 (#19299)
- Rename function prefix mb to the more accurate utf_cp (#19590)
- Remove some unused includes
- Change remaining sourcing_name/sourcing_lnum to exestack
- Change FALSE/TRUE to false/true
- api: Use a hashy hash for looking up api method and event names
- api: Use a unpacker based on libmpack instead of msgpack-c
- api: restructure api/vim.c and api/private/helpers.c code in separate files
- api: Remove redundant fields of CmdParseInfo
- aucmd: Call define_autocmd() directly for default autocmds
- ci: Cleanup release.yml #19132
- cmd: Format do_one_cmd()
- cmd: Hoist out some code into functions
- cmd: Unify execute_cmd with do_one_cmd
- decor: Use decor levels properly
- drawline.c: Factor out utf8 multibyte check
- eval: Use Hashy McHashFace instead of gperf
- eval.c: Resolve all clint issues (#19774)
- eval/funcs.c: Resolve all clint errors
- events: Remove unnecessary fudging of updating_screen
- ex_cd: Add an early return to fix clint warning
- ex_docmd.c: Resolve most clint errors (#19775)
- filetype: Allow vim.filetype.match to accept buf and filename (#19114)
- highlight: Make hlattrs2dict always use pre-allocated dict
- log: Simplify log_path_init #18898
- log: Use msg_schedule_semsg #18950
- lsp: Remove redundant client cleanup (#18744)
- lsp: Make the use of local aliases more consistent
- lsp: Use autocmd api (#19407)
- lsp: Factor out read_loop function
- lsp: Encapsulate rpc uv handle
- lsp: Extract rpc client from rpc.start
- lua: Replace hard-coded gsub with vim.pesc() (#18407)
- lua: Reformat with stylua 0.14.0 (#19264)
- lua: Git-blame-ignore stylua update PR (#19273)
- lua: Replace vim.cmd use with API calls (#19283)
- map: Simplify free_all_mem handling
- map: Statically initialize maphash array
- map: Simplify add_map params
- normal: Convert function comments to doxygen format
- object: Get rid of redundant FIXED_TEMP_ARRAY
- ops: Doxygen docstrings #17743
- option: DRY get/set option value #19038
- plines: Use a struct for chartabsize state
- provider: Use list comprehension #19027
- regexp_nfa.c: Match where Vim calls fopen() (#18778)
- runtime: Convert dist#ft functions to lua (#18247)
- runtime: Convert more dist#ft functions to lua (#18430)
- runtime: Convert the remaining dist#ft functions to lua (#18623)
- runtime: Port remaining patterns from filetype.vim to filetype.lua (#18814)
- runtime: Refactor filetype.lua (#18813)
- runtime: Port scripts.vim to lua (#18710)
- setcellwidths: Use TV_LIST_ITEM_NEXT properly
- signs: Handle non-sign attrs separately (#19784)
- tests: Introduce testprg()
- treesitter: Get_{nodes,captures}_at_{position,cursor}
- typval: Change FC_CFUNC abstraction into FC_LUAREF
- ui: Simplify stdin handling
- uncrustify: Format all c code under /src/nvim/
- vim.opt: Remove del arg
- vim.opt: Unify vim.bo/wo building
- vim.opt: Optimize append/prepend/remove
- Format runtime with stylua
2022-09-30 08:09:47 -07:00
|
|
|
set(NVIM_API_PRERELEASE false)
|
api: Nvim version, API level #5386
The API level is disconnected from the NVIM version. The API metadata
holds the current API level, and the lowest backwards-compatible level
supported by this instance.
Release 0.1.6 will be the first release reporting the Nvim version and
API level.
metadata['version'] = {
major: 0,
minor: 1,
patch: 6,
prerelease: true,
api_level: 1,
api_compatible: 0,
}
The API level may remain unchanged across Neovim releases if the API has
not changed.
When changing the API the CMake variable NVIM_API_PRERELEASE is set to
true, and NVIM_API_CURRENT/NVIM_API_COMPATIBILITY are incremented
accordingly.
The functional tests check the API table against fixtures of past
versions of Neovim. It compares all the functions in the old table with
the new one, it does ignore some metadata attributes that do not alter
the function signature or were removed since 0.1.5. Currently the only
fixture is 0.mpack, generated from Neovim 0.1.5 with nvim --api-info.
2016-09-25 10:46:37 -07:00
|
|
|
|
2014-11-09 05:52:15 -07:00
|
|
|
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
|
|
|
|
# NVIM_VERSION_CFLAGS set further below.
|
2014-01-31 06:39:15 -07:00
|
|
|
|
2019-02-15 13:18:16 -07:00
|
|
|
# Log level (MIN_LOG_LEVEL in log.h)
|
|
|
|
if("${MIN_LOG_LEVEL}" MATCHES "^$")
|
2019-12-02 09:12:51 -07:00
|
|
|
# Minimize logging for release-type builds.
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release"
|
|
|
|
OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"
|
|
|
|
OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
|
|
|
|
message(STATUS "MIN_LOG_LEVEL not specified, default is 3 (ERROR) for release builds")
|
|
|
|
set(MIN_LOG_LEVEL 3)
|
|
|
|
else()
|
|
|
|
message(STATUS "MIN_LOG_LEVEL not specified, default is 1 (INFO)")
|
|
|
|
set(MIN_LOG_LEVEL 1)
|
|
|
|
endif()
|
2019-02-15 13:18:16 -07:00
|
|
|
else()
|
|
|
|
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
|
|
|
|
message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL})
|
|
|
|
endif()
|
|
|
|
message(STATUS "MIN_LOG_LEVEL=${MIN_LOG_LEVEL}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Default to -O2 on release builds.
|
|
|
|
if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
|
|
|
|
message(STATUS "Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2")
|
|
|
|
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
|
|
|
endif()
|
|
|
|
|
2022-08-26 05:30:55 -07:00
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
2017-06-29 00:29:40 -07:00
|
|
|
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
|
|
|
else()
|
|
|
|
set(HAS_OG_FLAG 0)
|
2015-09-28 03:14:38 -07:00
|
|
|
endif()
|
|
|
|
|
2017-10-20 17:30:21 -07:00
|
|
|
#
|
|
|
|
# Build-type: RelWithDebInfo
|
|
|
|
#
|
2017-06-29 00:29:40 -07:00
|
|
|
if(HAS_OG_FLAG)
|
2017-10-20 17:30:21 -07:00
|
|
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
|
|
|
|
endif()
|
|
|
|
# We _want_ assertions in RelWithDebInfo build-type.
|
|
|
|
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
|
2017-06-29 00:29:40 -07:00
|
|
|
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
2015-09-28 03:14:38 -07:00
|
|
|
endif()
|
|
|
|
|
2017-02-11 17:02:54 -07:00
|
|
|
# gcc 4.0+ sets _FORTIFY_SOURCE=2 automatically. This currently
|
2014-11-04 15:06:18 -07:00
|
|
|
# does not work with Neovim due to some uses of dynamically-sized structures.
|
2017-02-11 17:02:54 -07:00
|
|
|
# https://github.com/neovim/neovim/issues/223
|
2014-11-21 01:42:59 -07:00
|
|
|
include(CheckCSourceCompiles)
|
2014-12-16 04:02:42 -07:00
|
|
|
|
|
|
|
# Include the build type's default flags in the check for _FORTIFY_SOURCE,
|
|
|
|
# otherwise we may incorrectly identify the level as acceptable and find out
|
|
|
|
# later that it was not when optimizations were enabled. CFLAGS is applied
|
|
|
|
# even though you don't see it in CMAKE_REQUIRED_FLAGS.
|
|
|
|
set(INIT_FLAGS_NAME CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE})
|
|
|
|
string(TOUPPER ${INIT_FLAGS_NAME} INIT_FLAGS_NAME)
|
|
|
|
if(${INIT_FLAGS_NAME})
|
|
|
|
set(CMAKE_REQUIRED_FLAGS "${${INIT_FLAGS_NAME}}")
|
|
|
|
endif()
|
|
|
|
|
2016-02-09 14:22:30 -07:00
|
|
|
# Include <string.h> because some toolchains define _FORTIFY_SOURCE=2 in
|
|
|
|
# internal header files, which should in turn be #included by <string.h>.
|
2014-11-21 01:42:59 -07:00
|
|
|
check_c_source_compiles("
|
2016-02-09 14:22:30 -07:00
|
|
|
#include <string.h>
|
|
|
|
|
2014-11-21 01:42:59 -07:00
|
|
|
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
|
|
|
|
#error \"_FORTIFY_SOURCE > 1\"
|
|
|
|
#endif
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2015-06-04 02:08:26 -07:00
|
|
|
" HAS_ACCEPTABLE_FORTIFY)
|
2014-11-21 01:42:59 -07:00
|
|
|
|
2015-06-04 02:08:26 -07:00
|
|
|
if(NOT HAS_ACCEPTABLE_FORTIFY)
|
2018-10-06 09:45:34 -07:00
|
|
|
message(STATUS "Unsupported _FORTIFY_SOURCE found, forcing _FORTIFY_SOURCE=1")
|
2014-12-12 10:45:21 -07:00
|
|
|
# Extract possible prefix to _FORTIFY_SOURCE (e.g. -Wp,-D_FORTIFY_SOURCE).
|
|
|
|
STRING(REGEX MATCH "[^\ ]+-D_FORTIFY_SOURCE" _FORTIFY_SOURCE_PREFIX "${CMAKE_C_FLAGS}")
|
|
|
|
STRING(REPLACE "-D_FORTIFY_SOURCE" "" _FORTIFY_SOURCE_PREFIX "${_FORTIFY_SOURCE_PREFIX}" )
|
2015-08-26 15:00:33 -07:00
|
|
|
if(NOT _FORTIFY_SOURCE_PREFIX STREQUAL "")
|
2018-10-06 09:45:34 -07:00
|
|
|
message(STATUS "Detected _FORTIFY_SOURCE Prefix=${_FORTIFY_SOURCE_PREFIX}")
|
2014-12-12 10:45:21 -07:00
|
|
|
endif()
|
2014-11-04 15:06:18 -07:00
|
|
|
# -U in add_definitions doesn't end up in the correct spot, so we add it to
|
|
|
|
# the flags variable instead.
|
2014-12-12 10:45:21 -07:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_FORTIFY_SOURCE_PREFIX}-U_FORTIFY_SOURCE ${_FORTIFY_SOURCE_PREFIX}-D_FORTIFY_SOURCE=1")
|
2014-11-04 15:06:18 -07:00
|
|
|
endif()
|
|
|
|
|
2015-09-30 11:38:34 -07:00
|
|
|
# Remove --sort-common from linker flags, as this seems to cause bugs (see #2641, #3374).
|
|
|
|
# TODO: Figure out the root cause.
|
|
|
|
if(CMAKE_EXE_LINKER_FLAGS MATCHES "--sort-common" OR
|
|
|
|
CMAKE_SHARED_LINKER_FLAGS MATCHES "--sort-common" OR
|
|
|
|
CMAKE_MODULE_LINKER_FLAGS MATCHES "--sort-common")
|
2018-10-06 09:45:34 -07:00
|
|
|
message(STATUS "Removing --sort-common from linker flags")
|
2015-09-30 11:38:34 -07:00
|
|
|
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
string(REGEX REPLACE ",--sort-common(=[^,]+)?" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
|
|
|
|
|
|
|
# If no linker flags remain for a -Wl argument, remove it.
|
|
|
|
# '-Wl$' will match LDFLAGS="-Wl,--sort-common",
|
|
|
|
# '-Wl ' will match LDFLAGS="-Wl,--sort-common -Wl,..."
|
|
|
|
string(REGEX REPLACE "-Wl($| )" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
string(REGEX REPLACE "-Wl($| )" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
string(REGEX REPLACE "-Wl($| )" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
|
|
|
endif()
|
|
|
|
|
2017-07-30 14:02:41 -07:00
|
|
|
check_c_source_compiles("
|
|
|
|
#include <execinfo.h>
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
void *trace[1];
|
2019-08-07 03:49:33 -07:00
|
|
|
backtrace(trace, 1);
|
2017-07-30 14:02:41 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
" HAVE_EXECINFO_BACKTRACE)
|
|
|
|
|
2019-01-08 14:00:52 -07:00
|
|
|
check_c_source_compiles("
|
|
|
|
int main(void)
|
|
|
|
{
|
2019-08-07 03:49:33 -07:00
|
|
|
int a = 42;
|
2019-01-08 14:00:52 -07:00
|
|
|
__builtin_add_overflow(a, a, &a);
|
|
|
|
__builtin_sub_overflow(a, a, &a);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
" HAVE_BUILTIN_ADD_OVERFLOW)
|
|
|
|
|
2022-07-02 14:47:22 -07:00
|
|
|
option(ENABLE_COMPILER_SUGGESTIONS "Enable -Wsuggest compiler warnings" OFF)
|
2015-08-27 19:00:09 -07:00
|
|
|
if(MSVC)
|
|
|
|
# XXX: /W4 gives too many warnings. #3241
|
2019-06-29 11:37:48 -07:00
|
|
|
add_compile_options(/W3)
|
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
2022-09-17 18:17:15 -07:00
|
|
|
add_definitions(-DMSWIN)
|
2015-08-27 19:00:09 -07:00
|
|
|
else()
|
2019-06-29 11:37:48 -07:00
|
|
|
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
|
2019-01-29 18:26:12 -07:00
|
|
|
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
2022-03-24 04:14:04 -07:00
|
|
|
-Wdouble-promotion
|
|
|
|
-Wmissing-noreturn
|
|
|
|
-Wmissing-format-attribute
|
2019-01-29 18:26:12 -07:00
|
|
|
-Wmissing-prototypes)
|
2016-02-27 18:20:27 -07:00
|
|
|
|
2020-06-19 19:18:30 -07:00
|
|
|
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
|
|
|
if(HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
2019-06-29 11:37:48 -07:00
|
|
|
add_compile_options(-Wimplicit-fallthrough)
|
2017-05-02 20:58:04 -07:00
|
|
|
endif()
|
|
|
|
|
2022-07-02 14:47:22 -07:00
|
|
|
if(ENABLE_COMPILER_SUGGESTIONS)
|
|
|
|
# Clang doesn't have -Wsuggest-attribute so check for each one.
|
|
|
|
check_c_compiler_flag(-Wsuggest-attribute=pure HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
|
|
|
if(HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
|
|
|
add_compile_options(-Wsuggest-attribute=pure)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
check_c_compiler_flag(-Wsuggest-attribute=const HAVE_WSUGGEST_ATTRIBUTE_CONST)
|
|
|
|
if(HAVE_WSUGGEST_ATTRIBUTE_CONST)
|
|
|
|
add_compile_options(-Wsuggest-attribute=const)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
check_c_compiler_flag(-Wsuggest-attribute=malloc HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
|
|
|
|
if(HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
|
|
|
|
add_compile_options(-Wsuggest-attribute=malloc)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
check_c_compiler_flag(-Wsuggest-attribute=cold HAVE_WSUGGEST_ATTRIBUTE_COLD)
|
|
|
|
if(HAVE_WSUGGEST_ATTRIBUTE_COLD)
|
|
|
|
add_compile_options(-Wsuggest-attribute=cold)
|
|
|
|
endif()
|
2022-03-24 04:14:04 -07:00
|
|
|
endif()
|
|
|
|
|
2016-02-27 18:20:27 -07:00
|
|
|
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
|
|
|
# 3.4.1 used there.
|
2017-05-21 04:44:02 -07:00
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
2019-06-29 11:37:48 -07:00
|
|
|
add_compile_options(-Wno-c11-extensions)
|
2016-02-27 18:20:27 -07:00
|
|
|
endif()
|
2015-08-27 19:00:09 -07:00
|
|
|
endif()
|
|
|
|
|
2022-05-17 06:08:24 -07:00
|
|
|
if(MINGW)
|
|
|
|
# Use POSIX compatible stdio in Mingw
|
|
|
|
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
2022-09-17 18:17:15 -07:00
|
|
|
add_definitions(-DMSWIN)
|
2022-05-17 06:08:24 -07:00
|
|
|
endif()
|
2018-03-04 16:44:23 -07:00
|
|
|
if(WIN32)
|
|
|
|
# Windows Vista is the minimum supported version
|
2015-02-03 06:31:33 -07:00
|
|
|
add_definitions(-D_WIN32_WINNT=0x0600)
|
2014-07-03 06:32:09 -07:00
|
|
|
endif()
|
2014-05-14 16:08:41 -07:00
|
|
|
|
2015-10-02 09:51:45 -07:00
|
|
|
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
|
|
|
|
check_c_compiler_flag(-Wvla HAS_WVLA_FLAG)
|
|
|
|
if(HAS_WVLA_FLAG)
|
2019-06-29 11:37:48 -07:00
|
|
|
add_compile_options(-Wvla)
|
2015-10-02 09:51:45 -07:00
|
|
|
endif()
|
|
|
|
|
2015-10-13 16:46:32 -07:00
|
|
|
if(UNIX)
|
|
|
|
# -fstack-protector breaks non Unix builds even in Mingw-w64
|
|
|
|
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
|
|
|
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
|
|
|
|
|
|
|
|
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
2019-06-29 11:37:48 -07:00
|
|
|
add_compile_options(-fstack-protector-strong)
|
2019-10-26 12:36:26 -07:00
|
|
|
link_libraries(-fstack-protector-strong)
|
2015-10-13 16:46:32 -07:00
|
|
|
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
2019-06-29 11:37:48 -07:00
|
|
|
add_compile_options(-fstack-protector --param ssp-buffer-size=4)
|
2019-10-26 12:36:26 -07:00
|
|
|
link_libraries(-fstack-protector --param ssp-buffer-size=4)
|
2015-10-13 16:46:32 -07:00
|
|
|
endif()
|
2015-08-26 15:00:33 -07:00
|
|
|
endif()
|
|
|
|
|
2020-02-17 10:04:01 -07:00
|
|
|
check_c_compiler_flag(-fno-common HAVE_FNO_COMMON)
|
|
|
|
if (HAVE_FNO_COMMON)
|
|
|
|
add_compile_options(-fno-common)
|
|
|
|
endif()
|
|
|
|
|
2015-08-27 00:56:46 -07:00
|
|
|
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
|
|
|
|
if(HAS_DIAG_COLOR_FLAG)
|
2019-07-04 06:24:33 -07:00
|
|
|
if(CMAKE_GENERATOR MATCHES "Ninja")
|
|
|
|
add_compile_options(-fdiagnostics-color=always)
|
|
|
|
else()
|
|
|
|
add_compile_options(-fdiagnostics-color=auto)
|
|
|
|
endif()
|
2015-08-27 00:56:46 -07:00
|
|
|
endif()
|
|
|
|
|
2020-11-12 11:20:00 -07:00
|
|
|
option(CI_BUILD "CI, extra flags will be set" OFF)
|
2014-05-14 16:08:41 -07:00
|
|
|
|
2020-11-12 11:20:00 -07:00
|
|
|
if(CI_BUILD)
|
|
|
|
message(STATUS "CI build enabled")
|
2019-06-29 11:37:48 -07:00
|
|
|
add_compile_options(-Werror)
|
2022-05-05 17:49:26 -07:00
|
|
|
if(DEFINED ENV{BUILD_UCHAR})
|
2016-10-09 10:55:08 -07:00
|
|
|
# Get some test coverage for unsigned char
|
2019-06-29 11:37:48 -07:00
|
|
|
add_compile_options(-funsigned-char)
|
2016-10-09 10:55:08 -07:00
|
|
|
endif()
|
2014-05-14 16:08:41 -07:00
|
|
|
endif()
|
2014-02-27 05:27:20 -07:00
|
|
|
|
2018-01-02 18:25:42 -07:00
|
|
|
option(LOG_LIST_ACTIONS "Add list actions logging" OFF)
|
|
|
|
|
2014-11-08 04:49:04 -07:00
|
|
|
add_definitions(-DINCLUDE_GENERATED_DECLARATIONS)
|
|
|
|
|
2018-06-15 05:33:07 -07:00
|
|
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
2018-06-16 07:18:55 -07:00
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
|
|
|
set(NO_UNDEFINED "-Wl,--no-undefined -lsocket")
|
|
|
|
elseif(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
|
set(NO_UNDEFINED "-Wl,--no-undefined")
|
|
|
|
endif()
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${NO_UNDEFINED}")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${NO_UNDEFINED}")
|
2016-01-24 19:16:00 -07:00
|
|
|
|
|
|
|
# For O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW flags on older systems
|
|
|
|
# (pre POSIX.1-2008: glibc 2.11 and earlier). #4042
|
2017-05-13 22:43:07 -07:00
|
|
|
# For ptsname(). #6743
|
2016-01-24 19:16:00 -07:00
|
|
|
add_definitions(-D_GNU_SOURCE)
|
2014-05-14 18:14:28 -07:00
|
|
|
endif()
|
|
|
|
|
2020-07-11 05:35:12 -07:00
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT PREFER_LUA AND LUAJIT_VERSION LESS "2.1.0-beta3")
|
|
|
|
# Required for luajit < 2.1.0-beta3.
|
2014-10-17 03:50:13 -07:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS
|
|
|
|
"${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS
|
|
|
|
"${CMAKE_SHARED_LINKER_FLAGS} -image_base 100000000")
|
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS
|
|
|
|
"${CMAKE_MODULE_LINKER_FLAGS} -image_base 100000000")
|
|
|
|
endif()
|
|
|
|
|
2022-06-27 03:08:59 -07:00
|
|
|
include_directories("${PROJECT_BINARY_DIR}/cmake.config")
|
2014-04-03 12:00:43 -07:00
|
|
|
include_directories("${PROJECT_SOURCE_DIR}/src")
|
|
|
|
|
2019-07-09 09:55:16 -07:00
|
|
|
find_package(LibUV 1.28.0 REQUIRED)
|
2014-05-15 04:21:13 -07:00
|
|
|
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
2014-04-03 12:00:43 -07:00
|
|
|
|
2016-02-04 20:21:51 -07:00
|
|
|
find_package(Msgpack 1.0.0 REQUIRED)
|
2014-05-15 04:21:13 -07:00
|
|
|
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
2014-04-10 11:39:34 -07:00
|
|
|
|
2022-02-27 05:49:50 -07:00
|
|
|
find_package(LibLUV 1.43.0 REQUIRED)
|
2019-06-10 05:13:18 -07:00
|
|
|
include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS})
|
|
|
|
|
2020-11-09 13:15:03 -07:00
|
|
|
find_package(TreeSitter REQUIRED)
|
|
|
|
include_directories(SYSTEM ${TreeSitter_INCLUDE_DIRS})
|
2020-09-17 02:25:22 -07:00
|
|
|
|
2021-06-29 06:59:57 -07:00
|
|
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${TreeSitter_INCLUDE_DIRS}")
|
|
|
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "${TreeSitter_LIBRARIES}")
|
|
|
|
check_c_source_compiles("
|
|
|
|
#include <tree_sitter/api.h>
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
TSQueryCursor *cursor = ts_query_cursor_new();
|
|
|
|
ts_query_cursor_set_match_limit(cursor, 32);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
" TS_HAS_SET_MATCH_LIMIT)
|
|
|
|
if(TS_HAS_SET_MATCH_LIMIT)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT")
|
|
|
|
endif()
|
2022-01-09 03:13:49 -07:00
|
|
|
check_c_source_compiles("
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <tree_sitter/api.h>
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
ts_set_allocator(malloc, calloc, realloc, free);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
" TS_HAS_SET_ALLOCATOR)
|
|
|
|
if(TS_HAS_SET_ALLOCATOR)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
|
|
|
|
endif()
|
2021-06-29 06:59:57 -07:00
|
|
|
|
2022-06-27 01:02:02 -07:00
|
|
|
# The unit test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
2017-05-13 04:57:08 -07:00
|
|
|
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
|
2017-01-20 16:33:09 -07:00
|
|
|
|
2017-05-13 04:57:08 -07:00
|
|
|
if(PREFER_LUA)
|
2022-05-25 07:11:53 -07:00
|
|
|
find_package(Lua 5.1 EXACT REQUIRED)
|
2017-05-13 04:57:08 -07:00
|
|
|
set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
|
|
|
|
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
|
2018-06-01 11:17:24 -07:00
|
|
|
# Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
|
2017-05-13 04:57:08 -07:00
|
|
|
find_package(LuaJit)
|
|
|
|
else()
|
|
|
|
find_package(LuaJit REQUIRED)
|
|
|
|
set(LUA_PREFERRED_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIRS})
|
|
|
|
set(LUA_PREFERRED_LIBRARIES ${LUAJIT_LIBRARIES})
|
2017-01-20 16:33:09 -07:00
|
|
|
endif()
|
2016-03-04 11:55:28 -07:00
|
|
|
|
2017-03-30 08:05:48 -07:00
|
|
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
|
|
|
|
check_c_source_compiles("
|
|
|
|
#include <msgpack.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
return MSGPACK_OBJECT_FLOAT32;
|
|
|
|
}
|
|
|
|
" MSGPACK_HAS_FLOAT32)
|
2019-07-05 03:19:13 -07:00
|
|
|
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
|
2017-03-30 08:05:48 -07:00
|
|
|
if(MSGPACK_HAS_FLOAT32)
|
2018-06-17 20:29:39 -07:00
|
|
|
add_definitions(-DNVIM_MSGPACK_HAS_FLOAT32)
|
2017-03-30 08:05:48 -07:00
|
|
|
endif()
|
|
|
|
|
2017-03-17 17:06:47 -07:00
|
|
|
option(FEAT_TUI "Enable the Terminal UI" ON)
|
2015-02-13 08:06:05 -07:00
|
|
|
|
2016-05-23 14:16:39 -07:00
|
|
|
if(FEAT_TUI)
|
2019-09-06 14:39:41 -07:00
|
|
|
find_package(UNIBILIUM 2.0 REQUIRED)
|
2016-05-23 14:16:39 -07:00
|
|
|
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
|
|
|
|
|
2017-09-16 20:13:35 -07:00
|
|
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
|
|
|
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
|
|
|
|
check_c_source_compiles("
|
|
|
|
#include <unibilium.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
return unibi_num_from_var(unibi_var_from_num(0));
|
|
|
|
}
|
|
|
|
" UNIBI_HAS_VAR_FROM)
|
2019-07-05 03:19:13 -07:00
|
|
|
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
|
|
|
|
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
|
2017-09-16 20:13:35 -07:00
|
|
|
if(UNIBI_HAS_VAR_FROM)
|
2018-06-17 20:29:39 -07:00
|
|
|
add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM)
|
2017-09-16 20:13:35 -07:00
|
|
|
endif()
|
|
|
|
|
2022-09-28 00:28:15 -07:00
|
|
|
find_package(LibTermkey 0.22 REQUIRED)
|
2016-05-23 14:16:39 -07:00
|
|
|
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
|
|
|
endif()
|
2015-02-13 08:06:05 -07:00
|
|
|
|
2022-09-28 00:30:47 -07:00
|
|
|
find_package(LIBVTERM 0.3 REQUIRED)
|
2015-02-28 06:41:53 -07:00
|
|
|
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
|
|
|
|
|
2015-06-09 01:43:22 -07:00
|
|
|
option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
|
2015-06-08 09:49:23 -07:00
|
|
|
option(CLANG_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
|
2015-06-09 01:43:22 -07:00
|
|
|
option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
|
|
|
|
|
|
|
|
if((CLANG_ASAN_UBSAN AND CLANG_MSAN)
|
|
|
|
OR (CLANG_ASAN_UBSAN AND CLANG_TSAN)
|
|
|
|
OR (CLANG_MSAN AND CLANG_TSAN))
|
2018-10-06 09:45:34 -07:00
|
|
|
message(FATAL_ERROR "Sanitizers cannot be enabled simultaneously")
|
2015-06-08 09:49:23 -07:00
|
|
|
endif()
|
2015-06-09 01:43:22 -07:00
|
|
|
|
|
|
|
if((CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) AND NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
|
2018-10-06 09:45:34 -07:00
|
|
|
message(FATAL_ERROR "Sanitizers are only supported for Clang")
|
2015-04-12 07:40:08 -07:00
|
|
|
endif()
|
|
|
|
|
2020-01-28 01:56:26 -07:00
|
|
|
if(ENABLE_LIBICONV)
|
|
|
|
find_package(Iconv REQUIRED)
|
|
|
|
include_directories(SYSTEM ${Iconv_INCLUDE_DIRS})
|
|
|
|
endif()
|
|
|
|
|
2018-06-01 11:17:24 -07:00
|
|
|
if(ENABLE_LIBINTL)
|
|
|
|
# LibIntl (not Intl) selects our FindLibIntl.cmake script. #8464
|
|
|
|
find_package(LibIntl REQUIRED)
|
2014-11-08 14:09:47 -07:00
|
|
|
include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS})
|
2014-04-03 12:00:43 -07:00
|
|
|
endif()
|
|
|
|
|
2014-02-24 11:52:12 -07:00
|
|
|
# Determine platform's threading library. Set CMAKE_THREAD_PREFER_PTHREAD
|
2014-06-25 14:47:27 -07:00
|
|
|
# explicitly to indicate a strong preference for pthread.
|
2014-02-24 11:52:12 -07:00
|
|
|
set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
2016-01-08 19:40:57 -07:00
|
|
|
# Place targets in bin/ or lib/ for all build configurations
|
2014-03-03 08:09:06 -07:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
2014-11-30 19:22:46 -07:00
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
2016-01-08 19:40:57 -07:00
|
|
|
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()
|
2014-02-22 08:30:50 -07:00
|
|
|
|
2014-07-11 04:12:18 -07:00
|
|
|
# Find Lua interpreter
|
2014-07-11 04:12:10 -07:00
|
|
|
include(LuaHelpers)
|
2016-04-13 05:21:32 -07:00
|
|
|
set(LUA_DEPENDENCIES lpeg mpack bit)
|
2014-07-11 04:12:18 -07:00
|
|
|
if(NOT LUA_PRG)
|
2016-06-03 09:21:29 -07:00
|
|
|
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
|
2019-10-07 08:42:40 -07:00
|
|
|
unset(_CHECK_LUA_PRG CACHE)
|
2014-07-11 04:12:18 -07:00
|
|
|
unset(LUA_PRG_WORKS)
|
2019-10-07 08:42:40 -07:00
|
|
|
find_program(_CHECK_LUA_PRG ${CURRENT_LUA_PRG})
|
2014-07-11 04:12:18 -07:00
|
|
|
|
2019-10-07 08:42:40 -07:00
|
|
|
if(_CHECK_LUA_PRG)
|
|
|
|
check_lua_deps(${_CHECK_LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
2014-07-11 04:12:18 -07:00
|
|
|
if(LUA_PRG_WORKS)
|
2019-10-07 08:42:40 -07:00
|
|
|
set(LUA_PRG "${_CHECK_LUA_PRG}" CACHE FILEPATH "Path to a program.")
|
2014-07-11 04:12:18 -07:00
|
|
|
break()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2019-10-07 08:42:40 -07:00
|
|
|
unset(_CHECK_LUA_PRG CACHE)
|
2014-07-11 04:12:18 -07:00
|
|
|
else()
|
|
|
|
check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
|
|
|
endif()
|
2014-04-13 03:06:35 -07:00
|
|
|
|
2014-07-11 04:12:10 -07:00
|
|
|
if(NOT LUA_PRG_WORKS)
|
2018-10-06 09:45:34 -07:00
|
|
|
message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter")
|
2014-04-13 03:06:35 -07:00
|
|
|
endif()
|
|
|
|
|
2018-10-06 09:45:34 -07:00
|
|
|
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
2014-04-13 03:06:35 -07:00
|
|
|
|
2022-06-25 10:24:48 -07:00
|
|
|
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
|
2021-12-19 14:00:53 -07:00
|
|
|
|
|
|
|
if(COMPILE_LUA AND NOT WIN32)
|
2021-12-16 09:27:39 -07:00
|
|
|
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")
|
2021-12-18 20:59:02 -07:00
|
|
|
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()
|
2021-12-16 09:27:39 -07:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(LUAC_PRG)
|
|
|
|
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
|
|
|
|
endif()
|
|
|
|
|
build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes #1201 and #1086.
2014-09-19 04:37:22 -07:00
|
|
|
# Setup busted.
|
2016-03-19 10:54:14 -07:00
|
|
|
find_program(BUSTED_PRG NAMES busted busted.bat)
|
2016-03-06 20:42:49 -07:00
|
|
|
find_program(BUSTED_LUA_PRG busted-lua)
|
build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes #1201 and #1086.
2014-09-19 04:37:22 -07:00
|
|
|
if(NOT BUSTED_OUTPUT_TYPE)
|
2017-05-25 05:51:53 -07:00
|
|
|
set(BUSTED_OUTPUT_TYPE "nvim")
|
build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes #1201 and #1086.
2014-09-19 04:37:22 -07:00
|
|
|
endif()
|
2014-03-03 08:09:06 -07:00
|
|
|
|
2022-06-12 15:08:01 -07:00
|
|
|
#
|
|
|
|
# Lint
|
|
|
|
#
|
|
|
|
find_program(LUACHECK_PRG luacheck)
|
|
|
|
find_program(STYLUA_PRG stylua)
|
|
|
|
find_program(UNCRUSTIFY_PRG uncrustify)
|
|
|
|
find_program(SHELLCHECK_PRG shellcheck)
|
2022-06-30 05:10:05 -07:00
|
|
|
|
2022-11-01 06:29:17 -07:00
|
|
|
add_glob_target(
|
2022-06-30 05:10:05 -07:00
|
|
|
REQUIRED
|
|
|
|
TARGET lintlua-luacheck
|
|
|
|
COMMAND ${LUACHECK_PRG}
|
|
|
|
FLAGS -q
|
|
|
|
GLOB_DIRS runtime/ scripts/ src/ test/
|
|
|
|
GLOB_PAT *.lua
|
|
|
|
TOUCH_STRATEGY SINGLE
|
|
|
|
)
|
|
|
|
|
2022-11-01 06:29:17 -07:00
|
|
|
add_glob_target(
|
2022-06-30 05:10:05 -07:00
|
|
|
TARGET lintlua-stylua
|
|
|
|
COMMAND ${STYLUA_PRG}
|
|
|
|
FLAGS --color=always --check
|
|
|
|
GLOB_DIRS runtime/
|
|
|
|
GLOB_PAT *.lua
|
|
|
|
TOUCH_STRATEGY SINGLE
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(lintlua)
|
|
|
|
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
|
2022-06-12 15:08:01 -07:00
|
|
|
|
build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes #1201 and #1086.
2014-09-19 04:37:22 -07:00
|
|
|
include(InstallHelpers)
|
2022-06-30 05:10:05 -07:00
|
|
|
|
2022-11-01 06:29:17 -07:00
|
|
|
add_glob_target(
|
2022-06-30 05:10:05 -07:00
|
|
|
TARGET lintsh
|
|
|
|
COMMAND ${SHELLCHECK_PRG}
|
|
|
|
FILES scripts/vim-patch.sh
|
|
|
|
TOUCH_STRATEGY SINGLE
|
|
|
|
)
|
build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes #1201 and #1086.
2014-09-19 04:37:22 -07:00
|
|
|
|
2022-07-01 09:15:04 -07:00
|
|
|
add_custom_target(lintcommit
|
|
|
|
COMMAND ${PROJECT_BINARY_DIR}/bin/nvim -u NONE -es -c [[lua require('scripts.lintcommit').main({trace=false})]]
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
VERBATIM)
|
|
|
|
add_dependencies(lintcommit nvim)
|
|
|
|
|
|
|
|
add_custom_target(lint)
|
2022-10-29 10:42:10 -07:00
|
|
|
add_dependencies(lint check-single-includes lintc lintlua lintsh lintcommit lintuncrustify)
|
2022-07-01 09:15:04 -07:00
|
|
|
|
2022-08-02 03:32:57 -07:00
|
|
|
#
|
|
|
|
# Format
|
|
|
|
#
|
|
|
|
add_custom_target(formatlua
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-D FORMAT_PRG=${STYLUA_PRG}
|
|
|
|
-D LANG=lua
|
|
|
|
-P ${PROJECT_SOURCE_DIR}/cmake/Format.cmake
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
|
|
|
|
|
|
|
add_custom_target(format)
|
|
|
|
add_dependencies(format formatc formatlua)
|
|
|
|
|
2015-05-17 11:45:30 -07:00
|
|
|
install_helper(
|
2022-06-27 01:02:02 -07:00
|
|
|
FILES ${CMAKE_SOURCE_DIR}/src/man/nvim.1
|
2015-05-17 11:45:30 -07:00
|
|
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
|
|
|
|
2019-02-15 13:18:16 -07:00
|
|
|
#
|
build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes #1201 and #1086.
2014-09-19 04:37:22 -07:00
|
|
|
# Go down the tree.
|
2019-02-15 13:18:16 -07:00
|
|
|
#
|
2014-03-03 08:09:06 -07:00
|
|
|
|
build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes #1201 and #1086.
2014-09-19 04:37:22 -07:00
|
|
|
add_subdirectory(src/nvim)
|
2019-09-06 11:36:05 -07:00
|
|
|
get_directory_property(NVIM_VERSION_CFLAGS DIRECTORY src/nvim DEFINITION NVIM_VERSION_CFLAGS)
|
build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes #1201 and #1086.
2014-09-19 04:37:22 -07:00
|
|
|
add_subdirectory(test/includes)
|
2022-06-27 03:08:59 -07:00
|
|
|
add_subdirectory(cmake.config)
|
2017-02-11 17:02:54 -07:00
|
|
|
add_subdirectory(test/functional/fixtures) # compile test programs
|
2015-04-02 09:45:34 -07:00
|
|
|
add_subdirectory(runtime)
|
2019-08-28 13:47:54 -07:00
|
|
|
get_directory_property(GENERATED_HELP_TAGS DIRECTORY runtime DEFINITION GENERATED_HELP_TAGS)
|
2018-05-19 23:27:52 -07:00
|
|
|
if(WIN32)
|
|
|
|
install_helper(
|
|
|
|
FILES ${DEPS_PREFIX}/share/nvim-qt/runtime/plugin/nvim_gui_shim.vim
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim-qt/runtime/plugin)
|
|
|
|
endif()
|
2015-02-23 08:34:20 -07:00
|
|
|
|
build: install with the correct permissions
The install() command will create the parent directories, but it does so
with the user's umask. We want to do our best to make sure the correct
permissions are being set, without clobbering existing permissions.
To do this, this commit introduces an install_helper(), which is similar
in signature to the install() command, to help ensure that directories
are created ahead of the actual install() command. This will attempt to
use 0644 permissions for files and 0755 permissions for directories by
default--though they can be overridden.
To make this work correctly, without trying to introduce some mechanism
with setting the umask, it meant that there's a small portion that makes
use of an "internal" version of the file() command. It has been tested
on CMake 2.8.11, 2.8.12, and 3.0.2, and works correctly on all versions.
This fixes #1201 and #1086.
2014-09-19 04:37:22 -07:00
|
|
|
# Setup some test-related bits. We do this after going down the tree because we
|
|
|
|
# need some of the targets.
|
2014-03-22 04:14:55 -07:00
|
|
|
if(BUSTED_PRG)
|
2014-04-30 02:10:37 -07:00
|
|
|
get_property(TEST_INCLUDE_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
PROPERTY INCLUDE_DIRECTORIES)
|
2014-07-15 14:35:08 -07:00
|
|
|
|
2016-05-16 03:49:32 -07:00
|
|
|
# When running tests from 'ninja' we need to use the
|
|
|
|
# console pool: to do so we need to use the USES_TERMINAL
|
|
|
|
# option, but this is only available in CMake 3.2
|
|
|
|
set(TEST_TARGET_ARGS)
|
2021-10-19 19:19:33 -07:00
|
|
|
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
|
2016-05-16 03:49:32 -07:00
|
|
|
|
2015-05-08 03:07:56 -07:00
|
|
|
set(UNITTEST_PREREQS nvim-test unittest-headers)
|
2022-06-22 05:51:52 -07:00
|
|
|
set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test pwsh-test streams-test tty-test ${GENERATED_HELP_TAGS})
|
2015-05-08 03:07:56 -07:00
|
|
|
set(BENCHMARK_PREREQS nvim tty-test)
|
|
|
|
|
2016-05-07 19:06:46 -07:00
|
|
|
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
|
|
|
|
if(LUA_HAS_FFI)
|
|
|
|
add_custom_target(unittest
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-DBUSTED_PRG=${BUSTED_PRG}
|
|
|
|
-DLUA_PRG=${LUA_PRG}
|
|
|
|
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
|
|
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
|
|
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
|
|
|
-DTEST_TYPE=unit
|
2022-10-17 08:16:31 -07:00
|
|
|
-DCIRRUS_CI=$ENV{CIRRUS_CI}
|
2016-05-07 19:06:46 -07:00
|
|
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
|
|
|
DEPENDS ${UNITTEST_PREREQS}
|
|
|
|
${TEST_TARGET_ARGS})
|
2018-06-17 05:54:39 -07:00
|
|
|
set_target_properties(unittest PROPERTIES FOLDER test)
|
2016-05-07 19:06:46 -07:00
|
|
|
else()
|
2017-02-11 17:02:54 -07:00
|
|
|
message(WARNING "disabling unit tests: no Luajit FFI in ${LUA_PRG}")
|
2016-05-07 19:06:46 -07:00
|
|
|
endif()
|
2014-09-29 05:43:52 -07:00
|
|
|
|
2018-06-16 07:20:25 -07:00
|
|
|
if(LUA_HAS_FFI)
|
|
|
|
set(TEST_LIBNVIM_PATH $<TARGET_FILE:nvim-test>)
|
2018-02-01 11:12:49 -07:00
|
|
|
else()
|
2018-06-16 07:20:25 -07:00
|
|
|
set(TEST_LIBNVIM_PATH "")
|
2018-02-01 11:12:49 -07:00
|
|
|
endif()
|
2018-06-16 07:20:25 -07:00
|
|
|
configure_file(
|
2022-06-27 03:08:59 -07:00
|
|
|
${CMAKE_SOURCE_DIR}/test/cmakeconfig/paths.lua.in
|
|
|
|
${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen)
|
2018-06-16 07:20:25 -07:00
|
|
|
file(GENERATE
|
2022-06-27 03:08:59 -07:00
|
|
|
OUTPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua
|
|
|
|
INPUT ${CMAKE_BINARY_DIR}/test/cmakeconfig/paths.lua.gen)
|
2018-02-01 11:12:49 -07:00
|
|
|
|
2014-11-05 03:54:20 -07:00
|
|
|
add_custom_target(functionaltest
|
2014-09-29 05:43:52 -07:00
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2014-10-08 08:56:28 -07:00
|
|
|
-DBUSTED_PRG=${BUSTED_PRG}
|
2016-07-13 00:37:50 -07:00
|
|
|
-DLUA_PRG=${LUA_PRG}
|
2014-11-05 05:26:35 -07:00
|
|
|
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
2014-09-29 05:43:52 -07:00
|
|
|
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
|
|
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
|
|
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
|
|
|
-DTEST_TYPE=functional
|
2022-10-17 08:16:31 -07:00
|
|
|
-DCIRRUS_CI=$ENV{CIRRUS_CI}
|
2014-11-10 17:26:01 -07:00
|
|
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
2016-05-16 03:49:32 -07:00
|
|
|
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
|
|
|
${TEST_TARGET_ARGS})
|
2022-06-17 00:58:48 -07:00
|
|
|
set_target_properties(functionaltest PROPERTIES FOLDER test)
|
2015-03-28 14:28:37 -07:00
|
|
|
|
|
|
|
add_custom_target(benchmark
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-DBUSTED_PRG=${BUSTED_PRG}
|
2016-07-13 00:37:50 -07:00
|
|
|
-DLUA_PRG=${LUA_PRG}
|
2015-03-28 14:28:37 -07:00
|
|
|
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
|
|
|
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
|
|
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
|
|
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
|
|
|
-DTEST_TYPE=benchmark
|
2022-10-17 08:16:31 -07:00
|
|
|
-DCIRRUS_CI=$ENV{CIRRUS_CI}
|
2015-03-28 14:28:37 -07:00
|
|
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
2016-05-16 03:49:32 -07:00
|
|
|
DEPENDS ${BENCHMARK_PREREQS}
|
|
|
|
${TEST_TARGET_ARGS})
|
2022-06-17 00:58:48 -07:00
|
|
|
set_target_properties(benchmark PROPERTIES FOLDER test)
|
2014-03-22 04:14:55 -07:00
|
|
|
endif()
|
2015-11-17 05:16:33 -07:00
|
|
|
|
2016-03-06 20:42:49 -07:00
|
|
|
if(BUSTED_LUA_PRG)
|
|
|
|
add_custom_target(functionaltest-lua
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-DBUSTED_PRG=${BUSTED_LUA_PRG}
|
2016-07-13 00:37:50 -07:00
|
|
|
-DLUA_PRG=${LUA_PRG}
|
2016-03-06 20:42:49 -07:00
|
|
|
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
|
|
|
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
|
|
|
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
|
|
|
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
|
|
|
-DTEST_TYPE=functional
|
2022-10-17 08:16:31 -07:00
|
|
|
-DCIRRUS_CI=$ENV{CIRRUS_CI}
|
2016-03-06 20:42:49 -07:00
|
|
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
2016-05-16 03:49:32 -07:00
|
|
|
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
|
|
|
${TEST_TARGET_ARGS})
|
2018-06-17 05:54:39 -07:00
|
|
|
set_target_properties(functionaltest-lua PROPERTIES FOLDER test)
|
2016-03-06 20:42:49 -07:00
|
|
|
endif()
|
|
|
|
|
2022-06-17 05:11:08 -07:00
|
|
|
add_custom_target(uninstall
|
|
|
|
COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/UninstallHelper.cmake)
|
2022-02-07 13:49:09 -07:00
|
|
|
|
|
|
|
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
2022-06-27 03:08:59 -07:00
|
|
|
add_subdirectory(cmake.packaging)
|
2022-02-07 13:49:09 -07:00
|
|
|
endif()
|