Commit Graph

13 Commits

Author SHA1 Message Date
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
Lewis Russell
f08051c2e6
feat!: make iconv a non-optional dep 2023-01-23 16:33:45 +00: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
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
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