]> git.ipfire.org Git - thirdparty/ccache.git/commit
build: Improve handling of dependencies (#1429)
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 27 Apr 2024 08:30:18 +0000 (10:30 +0200)
committerGitHub <noreply@github.com>
Sat, 27 Apr 2024 08:30:18 +0000 (10:30 +0200)
commit46ab182eb72c44a654c9fcbf8d17b934f9271d4c
tree9efe7e739b6fb9fc088fb00b8c60650d3823ef90
parentfb6291627272237fd3c7f75c05efa8d7dc32069e
parent04dad2827736749cd828d7c6b1d95e3994735e3e
build: Improve handling of dependencies (#1429)

- Introduced a new CMake variable called `DEPS` with the following
semantics:
- `AUTO` (the default): Use dependencies from the local system if
available. Otherwise: Use bundled dependencies if available. Otherwise:
Download dependencies from the internet (dependencies will then be
linked statically).
- `DOWNLOAD`: Use bundled dependencies if available. Otherwise: Download
recommended versions from the internet (dependencies will then be linked
statically).
- `LOCAL`: Use dependencies from the local system if available.
Otherwise: Use bundled dependencies if available.

The old `HIREDIS_FROM_INTERNET`, `ZSTD_FROM_INTERNET` and `OFFLINE`
variables have been removed in favor of `DEPS`.
- Streamlined the CMake code for hiredis and zstd.
- Removed bundled `getopt_long` implementation.

It seems likely that getopt_long is available on all platforms where
ccache is built nowadays, except Windows. Therefore, remove the bundled
getopt_long implementation for now.

If it turns out that somebody wants to compile ccache on a system that
lacks getopt_long we can add support specifying a system or downloaded
version.
- Implemented our own AVX2 runtime detection instead of using a blake3's
ditto. This opens up for using blake3 from the system.
- Added support for using blake3, httplib, nonstd/span and tl/expected
from the system instead of bundled versions.
- Removed bundled doctest, fmt and xxhash dependencies. Instead,
download them if missing.

Closes #1396.
Closes #1424.
.github/workflows/build.yaml