]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
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)
- 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.

1  2 
.github/workflows/build.yaml

index 498297a71140de0924db5f7902a957cfc8c76f43,08ff09b42058e6ec11ee270b1ba25b8da855e33e..3dff8d53435baf39d7471a8dcae506ea8db4b6da
@@@ -381,19 -398,9 +398,19 @@@ jobs
              CC: cl
              CXX: cl
              CMAKE_GENERATOR: Visual Studio 17 2022
-             CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON -A x64
+             CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -A x64
              TEST_CC: clang -target x86_64-pc-windows-msvc
  
 +          # Doesn't run tests as windows machines are x86
 +          - name: Windows VS2022 ARM64 MSBuild
 +            os: windows-2022
 +            msvc_arch: ARM64
 +            CC: cl
 +            CXX: cl
 +            CMAKE_GENERATOR: Visual Studio 17 2022
 +            CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON -DENABLE_TESTING=OFF -A ARM64
 +            RUN_TESTS: none
 +
            - name: Clang address & UB sanitizer
              os: ubuntu-20.04
              CC: clang