aboutsummaryrefslogtreecommitdiff
path: root/cmake
Commit message (Collapse)AuthorAge
* build: mark CMake variables advanced #31412Eisuke Kawashima2024-12-09
| | | The variables are not marked as advanced, thus they appear in e.g. `ccmake`.
* build: specify POST_BUILD when using add_custom_commanddundargoc2024-11-09
| | | | | | | | This is needed specifically for the second signature of add_custom_command, which appends an operation to an existing target. This will prevent the cmake warning CMP0175. Reference: https://cmake.org/cmake/help/latest/policy/CMP0175.html
* build(lpeg): search for lpeg.so on MacOSTom Scogland2024-10-22
| | | | | | | | | | Problem: Currently Neovim only searches for lpeg.dylib, liblpeg.dylib, etc. on MacOS, but a normal installation of lpeg will produce lpeg.so instead. There are explicit workarounds for this by modifying lpeg's package in Homebrew, and will shortly be another in spack. Solution: also search for lpeg.so even if that's not the platform default, because Lua and luarocks use it anyway.
* build: remove enforcement of cmake build typedundargoc2024-10-22
| | | | | | | | | | | Forcing the build type to be one of the default types was intended to prevent usage of custom build types which risks unpredictability. Unfortunately, many distributions patch this check out so they can use a custom type anyway, making the check moot in the first place. Instead, allow custom build types but don't try to accomodate them in the code: we're making the assumption that anyone who wants to use a custom build type will be able to set any additional necessary flags needed for their specific system.
* build(cmake): remove unnecessary policy codedundargoc2024-09-22
| | | | Policy CMP0092 is by default on for minimum cmake versions above 3.15.
* feat(treesitter): add support for wasm parsersLewis Russell2024-08-26
| | | | | | | | | | | | | | | | | | | | Problem: Installing treesitter parser is hard (harder than climbing to heaven). Solution: Add optional support for wasm parsers with `wasmtime`. Notes: * Needs to be enabled by setting `ENABLE_WASMTIME` for tree-sitter and Neovim. Build with `make CMAKE_EXTRA_FLAGS=-DENABLE_WASMTIME=ON DEPS_CMAKE_FLAGS=-DENABLE_WASMTIME=ON` * Adds optional Rust (obviously) and C11 dependencies. * Wasmtime comes with a lot of features that can negatively affect Neovim performance due to library and symbol table size. Make sure to build with minimal features and full LTO. * To reduce re-compilation times, install `sccache` and build with `RUSTC_WRAPPER=<path/to/sccache> make ...`
* build(deps): vendor libvterm at v0.3.3Christian Clason2024-08-10
| | | | | | | | Problem: Adding support for modern Nvim features (reflow, OSC 8, full utf8/emoji support) requires coupling libvterm to Nvim internals (e.g., utf8proc). Solution: Vendor libvterm at v0.3.3.
* build(deps): remove msgpack-c dependencybfredl2024-08-05
|
* build: add utf8proc as dependencydundargoc2024-06-28
| | | | | | | | | utf8proc contains all the data which is currently in unicode_tables.generated.h internally, but in quite a different format. Ideally unicode_tables.generated.h should be removed as well so we rely solely on utf8proc. We want to avoid a situation where the possibility of unicode mismatch occurs, e.g a distro using both unicode 12 and unicode 13.
* build: reuse code for deps.txt for both deps and main builddundargoc2024-05-28
|
* build: allow sccache as compiler cachedundargoc2024-05-09
| | | | | | Also enable caching for dependencies. Closes https://github.com/neovim/neovim/issues/28670
* build: simplify policy-setting for dependenciesdundargoc2024-05-03
| | | | | Passing `CMAKE_POLICY_DEFAULT_CMP0092=NEW` to all dependencies is simpler than setting it manually in each file.
* test: override XDG_STATE_HOME as well (#28604)zeertzjq2024-05-02
| | | This prevents tested Nvim from affecting ~/.local/state/
* build: do not use GIT_REPOSITORY for local dependenciesdundargoc2024-04-25
| | | | | | | | | This reverts a large portion of 2c1e8f7e96926f70151d737ea32f1e6ff3589263. The conclusion from that commit is incorrect: local builds are not used/updated correctly so much as it's not used at all. Instead the build will always use `master` branch rather than the current files.
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* build: add function add_targetdundargoc2024-04-08
| | | | | | | It's a combination of add_custom_target and add_custom_command that does what most users probably expect should happen. This also fixes `make clean` removing files tracked by git.
* ci: provide separate macos releases for intel and armdundargoc2024-03-24
| | | | | | This will immensely reduce the complexity required to support both architectures, reduce overall lines of code and unblock follow-up simplifications.
* build: use `GIT_REPOSITORY` for local URLsdundargoc2024-03-23
| | | | | | | `GIT_REPOSITORY` will cause cmake to rebuild if local dependency changes, which isn't the case for `URL`. Also document how to test a different commits of a dependency.
* build: introduce variable DEPS_IGNORE_SHA for skipping dependency hash checkdundargoc2024-03-19
| | | | | | | | This will reduce friction as developers no longer need to provide a hash when testing out different commits. To skip the hash check, set `DEPS_IGNORE_SHA` to `TRUE` in `cmake.deps/CMakeLists.txt`.
* build: set deps default build type to Release (#27495)Gregory Anders2024-02-16
| | | | | | | | | | | | | Debugging dependencies is rare so a Debug build type is usually not needed. In cases where it _is_ needed it is easy to rebuild in Debug mode. But since Release builds are more common, it makes more sense as a default. For Neovim itself we stick with a Debug build as a default, since rebuilding and debugging is done _much_ more frequently than with dependencies (which we _mostly_ expect to "just work"). Also remove the CMAKE_BUILD_TYPE variable in the Makefile, since this is set by default in CMake.
* fixup: raise TS min versionChristian Clason2024-01-25
|
* build: various build improvementsdundargoc2024-01-24
| | | | | | | | | | | | | | | | | | - remove "ran-" prefix from touch files as it's redundant since the they're already in the directory named `touches`. - Include `contrib` when formatting with `make formatlua`. - Use TARGET_FILE generator expression instead of assuming the executable location. - reuse logic that determines whether to use lua or luajit. - add translations to the `nvim` target. Makefile improvements: - rename variable `CMAKE_PRG` to `CMAKE` to make it more consistent with the builtin `MAKE` variable. - stop propagating flags to generator. Users should use cmake for non-standard use cases. - remove `+` prefix from targets. If the user for whatever reason wants to dry-run a target then they should be able to.
* fix(test): call separate_arguments() correctly to honor $BUSTED_ARGS (#26905)James McCoy2024-01-05
| | | | | separate_arguments() doesn't operate in place on a variable. It expects a string argument to parse and stores the results in the specified variable.
* build: cmake fixesdundargoc2023-12-16
| | | | | | | | | | | | | | - add EXTERNALPROJECT_OPTIONS variable to main build - use `REQUIRED` keyword for IWYU. - remove check_c_compiler_flag checks when `ENABLE_COMPILER_SUGGESTIONS` is `ON`. If we explicitly enable it then we probably want it to give an error if it doesn't exist, rather than silently skip it. - Move dependency interface libraries to their find module and use them as a pseudo-imported target. - Remove BUSTED_OUTPUT_TYPE. It's not used and we can reintroduce it again if something similar is needed. - Use LINK_OPTIONS intead of LINK_FLAGS when generating the `--version` output.
* build: bump minimum cmake version to 3.13dundargoc2023-12-16
| | | | | | | | | | | The benefits are primarily being able to use FetchContent, which allows for a more flexible dependency handling. Other various quality-of-life features such as `-B` and `-S` flags are also included. This also removes broken `--version` generation as it does not work for version 3.10 and 3.11 due to the `JOIN` generator expression. Reference: https://github.com/neovim/neovim/issues/24004
* build: remove config-specific find_package search for libuvdundargoc2023-12-09
| | | | Having two separate find_package calls makes it harder to maintain.
* build: rework formatting to use add_glob_targetdundargoc2023-12-04
| | | | | | | | | | | | This will ensure that we can pass flags and make adjustments from the top level cmake file instead of digging through the cmake directory. More importantly, this will only format files that have been changed. This has a slightly higher initial cost compared to previous solution as all files must be initially formatted, but the gained speed up should more than make up for it quickly. `make formatlua` is always run due to a quirk of stylua of always changing modification time of the file regardless if there were any changes. This is not a major blocker as stylua is very fast.
* build: vendor libtermkeydundargoc2023-11-30
| | | | | This is a proof of concept/WIP to evaluate the viability of vendoring libtermkey as it's been deprecated.
* docs: small fixes (#26154)dundargoc2023-11-27
|
* fixup: quick update, squash laterdundargoc2023-11-20
|
* build: disable all compiler warnings from dependenciesdundargoc2023-11-20
|
* build: bump required minimum libvterm version to 0.3.3dundargoc2023-10-28
| | | | Also add detection for libvterm patch version.
* build: enable formatting during rebasedundargoc2023-10-23
| | | | Closes https://github.com/neovim/neovim/issues/25654
* build: adjust how find order is prioritizeddundargoc2023-10-16
| | | | | | | | | | | | | | | | | | | Ensure bundled libraries and include directories are always searched first before any others. This will provide a more consistent experience as the search order of the builtin find_ functions can vary depending on system. This should make the build process faster when building with bundled deps as we limit the search to only the .deps directory. Separating the search between .deps and everything makes debugging find_-related problems simpler if you need to check how dependencies are found. For libraries, we divide the search process into the following order: 1. Only search in .deps directory and only search for static libraries. 2. Only search in .deps directory and search for all libraries. 3. Search everywhere and search for all libraries. Make an exception for FindLibintl.cmake as changing the search order seems to break some tests on macos.
* fix(tests): set SHELL=sh #24941Sergey Slipchenko2023-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Some tests fail with $SHELL=fish #6172 Related: https://github.com/neovim/neovim/pull/6176 Solution: Replace "echo -n" with "printf", because "echo" in sh may be provided as a shell builtin, which does not accept an "-n" flag to avoid a trailing newline (e.g. on macos). "printf" is more portable (defined by POSIX) and it does not output a trailing newline by itself. Fixes #6172 TODO: Other test failures may be related to "session leader" issue: https://github.com/neovim/neovim/issues/2354 Checked by running `:terminal ./build/bin/tty-test` from Nvim with `shell=/bin/fish` (inherited from `$SHELL`) and it indeed complains about "process does not own the terminal". With `shell=sh` it doesn't complain. And unsetting `$SHELL` seems to make `nvim` to fall back to `shell=sh`. FAILED test/functional/terminal/tui_spec.lua @ 1017: TUI paste: terminal mode test/functional/terminal/tui_spec.lua:1024: Row 1 did not match. Expected: |*tty ready | |*{1: } | |* | | | |{5:^^^^^^^ }| |{3:-- TERMINAL --} | |{3:-- TERMINAL --} | Actual: |*process does not own the terminal | |* | |*[Process exited 2]{1: } | | | |{5:^^^^^^^ }| |{3:-- TERMINAL --} | |{3:-- TERMINAL --} | To print the expect() call that would assert the current screen state, use screen:snapshot_util(). In case of non-deterministic failures, use screen:redraw_debug() to show all intermediate screen states. stack traceback: test/functional/ui/screen.lua:622: in function '_wait' test/functional/ui/screen.lua:352: in function 'expect' test/functional/terminal/tui_spec.lua:1024: in function <test/functional/terminal/tui_spec.lua:1017> FAILED test/functional/terminal/tui_spec.lua @ 1551: TUI forwards :term palette colors with termguicolors test/functional/terminal/tui_spec.lua:1567: Row 1 did not match. Expected: |*{1:t}ty ready | | | |* | | | |{2:^^^^^^^ }| | | |{3:-- TERMINAL --} | Actual: |*{1:p}rocess does not own the terminal | | | |*[Process exited 2] | | | |{2:^^^^^^^ }| | | |{3:-- TERMINAL --} | To print the expect() call that would assert the current screen state, use screen:snapshot_util(). In case of non-deterministic failures, use screen:redraw_debug() to show all intermediate screen states. stack traceback: test/functional/ui/screen.lua:622: in function '_wait' test/functional/ui/screen.lua:352: in function 'expect' test/functional/terminal/tui_spec.lua:1567: in function <test/functional/terminal/tui_spec.lua:1551>
* build: remove luarocksdundargoc2023-09-10
| | | | | Luarocks is no longer needed after 25e51d393a420765d5efd44c1b4be823a5cf280a.
* build(lua): vendor coxpcallbfredl2023-09-10
| | | | Do not require luarocks on PUC lua CI just because of this single lua file
* fix(deps): make sure --force-config takes effectSergey Slipchenko2023-09-09
| | | | | | | | | | | | | | Fixes #24881 --force-config passed to luarocks' configure script is only taken into account in case "make install" is used afterwards. But if "make bootstrap" is used then this flag has no effect. And it can actually copy an existing config on the system to the new installation. That existing config can have a different version of Lua set by default. In which case luarocks will install packages for that version instead of the one used in tests. And trying to run tests then will fail because of missing packages.
* refactor(build): derocksify luacheckbfredl2023-09-07
|
* build: various fixesdundargoc2023-09-04
| | | | | | | | | - simplify lua interpreter search - fix incorrect variable name in BuildLua.cmake - build PUC Lua with -O2 - silence non-mandatory find_package search for libuv - simplify Find modules - Prefer using the explicitly set CI_BUILD over relying on the environment variable "CI".
* build: download busted from own neovim/deps repositorydundargoc2023-09-03
| | | | | | | | Downloading the necessary files all at once instead of doing dependency handling with luarocks speeds up installation immensely. We speed up the process even more by using luv as a replacement for the C modules in the busted dependencies, which allows us to skip costly compilation times. Co-authored-by: bfredl <bjorn.linse@gmail.com>
* feat(version): unverbose ":version", ":verbose version" #24195Justin M. Keyes2023-07-01
| | | | | | | | | Problem: `nvim -v` and `:version` prints system vimrc, fallback files, and compilation info by default, which most people don't care about and just clutters up the output. Solution: Omit extra info unless 'verbose' is set.
* ci: introduce CI_LINT optiondundargoc2023-06-24
| | | | | | This will abort if lint programs are not found, and is meant primarily for the lint job in CI. Supersedes the REQUIRED argument in add_glob_target as it's a superior replacement by being a built-in solution.
* feat: report "build" in vim.version() #23925treatybreaker2023-06-11
| | | | | | | | | | Problem: Nvim version string typically has a "build" component but vim.version() doesn't report it. Solution: Add the "build" field to vim.version(). Closes #23863
* build: move luarocks and rocks installation to main builddundargoc2023-05-21
| | | | | | This will ensure luacheck and busted are only installed when they're actually needed. This cuts total build time by over 50%. Closes https://github.com/neovim/neovim/issues/22797.
* build: don't format deleted filesdundargoc2023-05-18
| | | Trying to format deleted files will otherwise throw an error.
* build: bundle uncrustifydundargoc2023-05-18
| | | | | | Uncrustify is sensitive to version changes, which causes friction for contributors that doesn't have that exact version. It's also simpler to download and install the correct version than to have bespoke version checking.
* build: cmake cleanupdundargoc2023-05-13
| | | | | | | | | | - Simplify error checking when using execute_process. - Set BUILD_SHARED_LIBS to OFF when building dependencies. This is normally not needed, but msgpack interprets an unset BUILD_SHARED_LIBS to build a shared library, which is the opposite of the cmake behavior. - Move function check_lua_module to Util.cmake. - Remove unnecessary code. - Make variable naming more consistent
* feat(treesitter): add support for setting query depthsLewis Russell2023-05-11
|
* build: make lpeg an imported librarydundargoc2023-04-30
| | | | | | | | | | | Cmake truncates the full link path to a shared library if it is missing an SONAME in some undocumented scenarios. This causes builds in some systems to fail if "lpeg" isn't a library on the system path. The path of imported libraries aren't modified by cmake, so we can use that as a workaround until a proper solution for this has been identified. Closes https://github.com/neovim/neovim/issues/23395.