Commit Graph

85 Commits

Author SHA1 Message Date
dundargoc
51863b2d66
build: remove tests for libtermkey (#21983)
The dependencies aren't set up properly meaning that this will cause a
failure on some systems such as void linux.

Closes https://github.com/neovim/neovim/issues/21982.
2023-01-24 15:24:15 +01:00
dundargoc
993dc6e97e
build: use upstream CMakeLists.txt for unibilium (#21976)
Also remove UnibiliumCMakeLists.txt as it's not necessary anymore.
2023-01-24 09:36:32 +01:00
dundargoc
bcbdb94185
build: simplify treesitter installation (#21969) 2023-01-24 08:55:56 +01:00
dundargoc
20a932cb72
build: use cmake for all platforms for unibilium and libtermkey (#21926)
It's simpler to rely on the same build file, especially if there aren't
any platform-specific workarounds like in this case.
2023-01-24 08:55:38 +01:00
dundargoc
63e67468b4
build: use CMAKE_POSITION_INDEPENDENT_CODE instead of -fPIC (#21947)
It's simpler to let cmake figure out what flags to add to each platforms
to create position independent code rather than handling it ourselves.

Also remove code that sets POSITION_INDEPENDENT_CODE property on SHARED
and MODULE libraries, as it's already on by default.
2023-01-22 18:02:02 +01:00
dundargoc
4c5c6ca800
build: various cmake fixes (#21902)
* build: various cmake refactors and simplifications

- Add STATUS keyword to message to ensure messages are shown in the
  correct order.
- Remove DEPS_CXX_COMPILER as we don't rely on C++ for any of our
  dependencies.
- Simplify how msgpack and luv configure options are constructed.
- Rely on the default installation for luv instead of manually passing
  configure, build and install commands.
- Simplify return code conditional.

* build: remove CMAKE_OSX_ARCHITECTURES_ALT_SEP workaround

CMAKE_OSX_ARCHITECTURES_ALT_SEP was defined as a workaround to prevent
the shell from interpreting `;`, which CMake uses as a list separator.
However, the same thing can be achieved by instead passing
CMAKE_OSX_ARCHITECTURES as a cache variable instead, which is a more
idiomatic way of achieving the same thing.

* build: define CMAKE_BUILD_TYPE before adding it to BUILD_TYPE_STRING

The problem with the current setup is that CMAKE_BUILD_TYPE is defined
after BUILD_TYPE_STRING. BUILD_TYPE_STRING will then be empty on the
first run, meaning that dependencies are built without a build type.
However, since CMAKE_BUILD_TYPE is a cache variable its value will
persist in subsequent runs. On the second run BUILD_TYPE_STRING will
have the correct value, but it's a different value from the ones the
dependencies were built with. This will force some dependencies to be
built again.

Fixes https://github.com/neovim/neovim/issues/21672.
2023-01-20 23:48:46 +01:00
dundargoc
0f91139074 build(cmake): add modelines to enable syntax highlighting 2022-10-21 11:48:12 +02:00
dundargoc
bc7daddaf0 build: rely on default cmake installation if possible
The default cmake installation process for dependencies that use cmake
on all platforms is in general more robust and less verbose, so we rely
on that if possible.
2022-10-21 11:48:12 +02:00
Wei Tang
8f0b94b36d
build(deps): disable shared library for libvterm. (#20566)
build(deps): disable shared library for libvterm

Problem:
Cannot build both static and share libraries for libvterm under Windows.
The static and shared library would have the same name "vterm.lib", thus there would be multiple rules to build the same target.

Solution:
Disable shared library for libvterm.

This makes it possible to use Ninja on Windows to build dependencies (2x speedup!).
But not for Release builds yet.

Co-authored-by: Wei Tang <gauchyler@uestc.edu.cn>
2022-10-10 17:46:34 -07:00
Wei Tang
3ddd99ec64
build(deps): add build type for libuv (#20575)
Problem:
Build type is not set in BuildLibuv.cmake, so libuv is always built for Debug type.

Solution:
Add build type for libuv.
2022-10-10 17:51:10 +02:00
James McCoy
61da959bb4
build(deps): restore support for USE_EXISTING_SRC_DIR (#20491)
59d5f692f removed cmake.deps/cmake/DownloadAndExtractFile.cmake and
support for USE_EXISTING_SRC_DIR.  The Ubuntu nightly PPA still relies
on USE_EXISTING_SRC_DIR functionality since it can't access the network
during the build.

Supplying an empty value for ExternalProject_Add()'s URL value appears
to provide the needed mechanism to avoid re-downloading when the sources
are already present.  This is undocumented behavior, though, so it may
break in the future.

Now, if USE_EXISTING_SRC_DIR is set, the ExternalProject's URL variable
is unset, preventing the download and erroring out if the source doesn't
actually exist.
2022-10-06 15:14:38 +02:00
dundargoc
fbc66d798c build: define EP_PREFIX property
This is just to avoid the boilerplate of definining PREFIX for
each dependency.
2022-10-02 12:47:14 +02:00
dundargoc
59d5f692f8 build: rely on builtin cmake downloading rather than custom script
DownloadAndExtractFile.cmake was initially introduced as a workaround to
avoid the massive amounts of logs generated by the download progress.
This is not a problem anymore as ExternalProject_Add has had the
DOWNLOAD_NO_PROGRESS option since cmake version 3.1.
2022-10-02 12:39:48 +02:00
dundargoc
543f939773 build: remove url for 32-bit winyank
We don't support 32bit Windows anymore, so it's not needed. Also remove
TargetArch.cmake and related code as we don't need architecture
detection for the same reason.
2022-10-02 12:39:20 +02:00
dundargoc
3ce325cfa2 build: remove code for cross-compilation
We don't support cross-compilation at the moment, so these can be safely
removed.
2022-10-02 12:39:20 +02:00
dundargoc
06addcfaa9 build: remove unused variable CMAKE_C_COMPILER_ARG1
It was set in file cmake/i386-linux-gnu.toolchain.cmake which has been
removed since we don't use Travis anymore.
2022-10-02 12:39:20 +02:00
Christian Clason
816026ba10
build(deps): bump libuv to HEAD - f610339f7 (#20445)
also remove libuv-disable-shared patch
2022-10-02 12:08:29 +02:00
Christian Clason
eb4844b5ed
build(macos): restore and test universal build (#20383)
Build tree-sitter parsers for arm64 as well as x86
Check that all created binaries contain both architectures
2022-09-28 11:06:11 +02:00
Justin M. Keyes
bde6176c91 feat(treesitter): bundle :help parser and queries
parser from https://github.com/vigoux/tree-sitter-vimdoc
queries from nvim-treesitter
2022-09-22 15:36:27 +02:00
dundargoc
7ae74998f0 build: remove unnecessary build functions
These functions serve no purpose if they're only used as intermediary
functions that passes on arguments to ExternalProject_Add.
2022-09-08 14:15:13 +02:00
dundargoc
b635f7ed41 build: remove ARGS from add_custom_command
It's a command that doesn't do anything, kept only for compatibility
reasons.
2022-09-08 14:15:13 +02:00
Eisuke Kawashima
c77bb5a528
build(treesitter): set CMAKE_C_STANDARD to C99 2022-09-07 06:33:58 +09:00
Christian Clason
694ac26946
Merge pull request #17329 from cryptomilk/asn-vterm-0-2
build(deps): bump libvterm to 0.3-RC1
2022-09-06 22:41:37 +02:00
Andreas Schneider
9ecaa35f55 build(deps): use libvterm 0.3-rc1 2022-09-06 21:48:14 +02:00
dundargoc
6e3a69b4cf
build: consistently set build type regardless of generator or platform #19760
Change the default build type to always be Debug, and allow only four
predefined build types: Debug, Release, RelWithDebInfo and MinRelSize.
Furthermore, flags meant for single-configuration generator (make,
ninja) will not be used for multi-configuration generators (visual
studio, Xcode), and flags meant for multi-configuration generators will
not be used for single-configuration generators.

This will allow Debug builds to be built with MSVC which requires that
all dependencies are also built with the Debug build type to avoid
runtime library mismatch.

The correct way to specify build type (for example Release) for
single-configuration generators (Make and Ninja) is to run

cmake -B build -D CMAKE_BUILD_TYPE=Release
cmake --build build

while for multi-configuration generators (Visual Studio, Xcode and Ninja
Multi-Config) is to run

cmake -B build
cmake --build build --config Release

Passing CMAKE_BUILD_TYPE for multi-config generators will now not only
not be used, but also generate a warning for the user.

Co-authored-by: dundargoc <gocundar@gmail.com>
2022-09-06 07:52:39 -07:00
Christian Clason
97f38f0a9b fix(treesitter): do not link @error by default
The @error capture is used for tree-sitter's ERROR node, which indicates
a parsing error -- which can be quite frequent (and jarring) while typing.

Users can still manually `hi link @error Error` in their config.
2022-09-06 07:57:46 +02:00
Christian Clason
e85b8aa768 feat(treesitter): add viml parser and queries 2022-09-06 07:57:46 +02:00
Thomas Vigouroux
905dd49fec feat(treesitter): bundle Lua parser and queries
parser from https://github.com/MunifTanjim/tree-sitter-lua
queries from nvim-treesitter
2022-09-06 07:57:46 +02:00
dundargoc
11837e9b29 build: only use CMAKE_BUILD_TYPE for single-config generators
CMAKE_BUILD_TYPE is ignored for multi-config generators and creates a
warning that it's unused.
2022-08-13 21:22:07 +02:00
dundargoc
2dde701115 build(MSVC): don't add non-MSVC compiler options
This will prevent warnings of the type "ignoring unknown option '-fPIC'"
when using MSVC.
2022-08-13 21:22:07 +02:00
dundargoc
bf0d7ed1f6 build: bump minimum cmake version for all dependencies to 3.10
This removes cmake policy warning for CMP0053 on windows and ensures the
build works correctly for newer cmake policies.
2022-08-13 21:22:07 +02:00
Lewis Russell
e23c5fda0a
build libuv cmake (#19632)
Co-authored-by: Daniel Hahler <git@thequod.de>
2022-08-12 16:59:40 +01:00
Christian Clason
9e15bdde3b
build(macos): use consistent MACOSX_DEPLOYMENT_TARGET (#19430)
Use the same logic for both deps (including LuaJIT, for which setting
this variable is mandatory) and Nvim: either the eponymous environment
variable if set, or the current software version if not.

Removes annoying warnings when building locally on macOS.
2022-07-19 16:10:59 +02:00
James McCoy
0a716fc776
build: bump minimum CMake version in cmake.deps
The minimum version for the main project was bumped in 035d82e0d3.
Align cmake.deps to the same version for consistency.
2022-07-19 07:02:51 -04: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