Commit Graph

25 Commits

Author SHA1 Message Date
dundargoc
c40872acbd
build: remove duplicate include directories in --version output
Having the same directory listed multiple times makes the --version
output needlessly complicated to visualize. This deduplication will only
work for cmake version 3.15 and above, which should be the majority of
neovim builds by now. For older cmake versions we default to the
previous behavior of listing duplicate include directories.
2023-05-18 16:27:05 +02:00
bfredl
e2fdd53d8c refactor(map): avoid duplicated khash_t types for values
This reduces the total number of khash_t instantiations from 22 to 8.

Make the khash internal functions take the size of values as a runtime
parameter. This is abstracted with typesafe Map containers which
are still specialized for both key, value type.

Introduce `Set(key)` type for when there is no value.

Refactor shada.c to use Map/Set instead of khash directly.
This requires `map_ref` operation to be more flexible.
Return pointers to both key and value, plus an indicator for new_item.
As a bonus, `map_key` is now redundant.

Instead of Map(cstr_t, FileMarks), use a pointer map as the FileMarks struct is
humongous.

Make `event_strings` actually work like an intern pool instead of wtf it
was doing before.
2023-05-17 12:26:21 +02:00
Lewis Russell
7bf1a917b7
vim-patch:8.1.2094: the fileio.c file is too big
Problem:    The fileio.c file is too big.
Solution:   Move buf_write() to bufwrite.c. (Yegappan Lakshmanan,
            closes vim/vim#4990)

c079f0fed1

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-04-19 13:15:29 +01:00
dundargoc
7100a80253
build: show build type specific compiler flags when using --version
The build type specific flags are defined in the variables
CMAKE_C_FLAGS_<CONFIG>, where <CONFIG> can be DEBUG, RELEASE,
RELWITHDEBINFO and MINSIZEREL.
2023-03-04 20:04:01 +01:00
bfredl
1b3c1f6c06 refactor(build): graduate HAVE_LOCALE_H feature
Merge locale.h into os/lang.h
Having a source file with the same name as a system header we use is
considered an anti-pattern.
2023-03-03 14:19:46 +01:00
bfredl
166b149d5b refactor(build): remove unused stdlib function and include checks
In addition: merge some checks for the same feature into one
test_compile. This reduces the total number of test compiles
which speeds up the cmake configure stage.
2023-03-03 14:19:46 +01:00
dundargoc
458299df79
fix: remove "Compiled by:" from :version/--version (#22316)
The :version output is already crowded as is, the last thing we need is
extraneous messages about who compiled it.
2023-02-18 20:10:00 +01:00
Gregory Anders
bb377afd32
build: use custom command to create single versiondef (#22290)
When using a multi config generator, CMake generates an output file for
each configuration when using file(GENERATE). When the contents of the
file for each configuration are different, CMake fails. Instead, create
separate files for each configuration and add a build time step to copy
the configuration specific file to the generic path "auto/versiondef.h"
which is included at build time.
2023-02-16 21:52:41 +01:00
Gregory Anders
ced0cd12d0
build: only use HOSTNAME_PRG if HOSTNAME is undefined (#22288)
Allow specifying the HOSTNAME variable by defining it with -D when
invoking CMake, instead of overriding it with the output of
HOSTNAME_RPG.
2023-02-16 12:36:55 -07:00
dundargoc
4c64cbe99f
build: mark uninteresting variables as advanced (#22208)
Only the most important variables should be shown by default.
2023-02-10 20:20:18 +01:00
dundargoc
964ae205a5
build: unbreak building neovim with multi-config generators (#22104)
file(GENERATE) has surprising behavior as it doesn't allow different
file contents for configurations with the same file name. This results
in an error when building neovim with a multi-config generator. Use a
workaround for now where we set the build type for multi-config
generators to "Unknown".
2023-02-03 10:53:57 +01:00
dundargoc
f9826e1dff
build: stop relying on CMAKE_BUILD_TYPE to determine the build type (#22051)
Any logic involving CMAKE_BUILD_TYPE is automatically broken as it won't
work with multi-config generators. The only exception is if we
explicitly check whether the current generator is single-config as well.
Instead, use generator expressions or cmake variables that allows to set
options for certain build types only such as
INTERPROCEDURAL_OPTIMIZATION_<CONFIG>.

Opt to generate all headers with optimization level O2 with no debug
information for all build types as that is the simplest way to make it
behave the same for all generators.
2023-02-03 00:00:15 +01:00
dundargoc
27b81af19c
refactor!: remove has("debug") (#22060)
This value can not be relied on as it doesn't work for
multi-configuration generators. I don't think this undocumented option
is used much, if at all, so I think we should remove it.
2023-01-30 19:06:32 +01:00
Lewis Russell
f08051c2e6
feat!: make iconv a non-optional dep 2023-01-23 16:33:45 +00:00
dundargoc
4c531714ff
refactor: replace char_u with char 25 (#21838)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-19 22:25:56 +08:00
dundargoc
3269902a13
refactor: fix IWYU mapping file and use IWYU (#21802)
Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
2023-01-15 14:16:33 +01:00
dundargoc
438b4361cc
build: use modern cmake (#21589)
Replace old-school cmake with the so-called "Modern CMake", meaning
preferring using targets and properties over directory settings and
variables. This allows greater flexibility, robustness and clarity over
how the code works.

The following deprecated commands will be replaced with their modern
alternatives that operates on a specific target, rather than all targets
in the current directory:

- add_compile_options -> target_compile_options
- include_directories -> target_include_directories
- link_libraries -> target_link_libraries
- add_definitions -> target_compile_definitions

There are mainly four main targets that we currently use: nvim, libnvim,
nvim-test (used by unittests) and ${texe} (used by
check-single-includes). The goal is to explicitly define the
dependencies of each target fully, rather than having everything be
dependent on everything else.
2023-01-10 18:49:57 +01:00
Lewis Russell
5841a97500
feat!: remove hardcopy
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-01-03 10:07:43 +00:00
Justin M. Keyes
a283a99165
refactor: eliminate os_unix.c #21621 2023-01-02 14:56:17 -08:00
zeertzjq
5322bf99e6
vim-patch:8.2.0711: temp directory might be cleared (#21614)
Problem:    With a long running Vim the temp directory might be cleared on
            some systems.
Solution:   Lock the temp directory. (closes vim/vim#6044)

b2d0e51366
2023-01-02 20:37:13 +08:00
bfredl
9fdcbbb406 feat(tui): graduate the +tui feature
This was previously disabled due to build issues on windows.
Any reasonable platform can now be expected to have the necessary
interfaces to build and run the TUI subsystem.

Runtime quality issues of using the TUI (on any new platform) are not
relevant here. Just run Nvim in an external UI instead of the TUI as always.
2022-12-31 13:25:26 +01:00
zeertzjq
0b79137c59
vim-patch:8.1.2001: some source files are too big (#21231)
Problem:    Some source files are too big.
Solution:   Move buffer and window related functions to evalbuffer.c and
            evalwindow.c. (Yegappan Lakshmanan, closes vim/vim#4898)

261f346f81
2022-11-29 16:47:29 +08:00
dundargoc
66360675cf build: allow IWYU to fix includes for all .c files
Allow Include What You Use to remove unnecessary includes and only
include what is necessary. This helps with reducing compilation times
and makes it easier to visualise which dependencies are actually
required.

Work on https://github.com/neovim/neovim/issues/549, but doesn't close
it since this only works fully for .c files and not headers.
2022-11-15 10:30:03 +01:00
Lewis Russell
288208257c feat(cscope)!: remove 2022-10-13 16:37:23 +01:00
Justin M. Keyes
f05a2891d3 build: rename build-related dirs
Problem:
Dirs "config", "packaging", and "third-party" are all closely related
but this is not obvious from the layout. This adds friction for new
contributors.

Solution:
- rename config/ to cmake.config/
- rename test/config/ to test/cmakeconfig/ because it is used in Lua
  tests: require('test.cmakeconfig.paths').
- rename packaging/ to cmake.packaging/
- rename third-party/ to cmake.deps/ (parallel with .deps/)
2022-06-28 04:02:29 -07:00