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.
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.
- 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".
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.