From: Joel Rosdahl Date: Tue, 3 Feb 2026 19:26:38 +0000 (+0100) Subject: build: Require a C++-20 compiler X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51466ac40eeb57a0d9b0edbdbc9f40ed2d753b7a;p=thirdparty%2Fccache.git build: Require a C++-20 compiler --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ed89db9..9f934fc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ else() endif() set(CMAKE_PROJECT_DESCRIPTION "a fast C/C++ compiler cache") -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED YES) set(CMAKE_CXX_EXTENSIONS NO) diff --git a/cmake/CodeAnalysis.cmake b/cmake/CodeAnalysis.cmake index 7bba40d2..09185595 100644 --- a/cmake/CodeAnalysis.cmake +++ b/cmake/CodeAnalysis.cmake @@ -10,7 +10,7 @@ if(ENABLE_CPPCHECK) -q --enable=all --force - --std=c++17 + --std=c++20 -I ${CMAKE_SOURCE_DIR} --template="cppcheck: warning: {id}:{file}:{line}: {message}" -i src/third_party) diff --git a/doc/install.md b/doc/install.md index b0dc5a78..c92ed95f 100644 --- a/doc/install.md +++ b/doc/install.md @@ -5,7 +5,7 @@ **Required:** - CMake 3.15 or newer -- A C++17 compiler (see [Supported platforms, compilers and +- A C++20 compiler (see [Supported platforms, compilers and languages](https://ccache.dev/platform-compiler-language-support.html) for details) - A C99 compiler diff --git a/dockerfiles/alma-8/Dockerfile b/dockerfiles/alma-8/Dockerfile index 723f9023..26a42fe8 100644 --- a/dockerfiles/alma-8/Dockerfile +++ b/dockerfiles/alma-8/Dockerfile @@ -17,6 +17,7 @@ RUN dnf install -y dnf-plugins-core \ fmt-devel \ gcc \ gcc-c++ \ + gcc-toolset-11 \ hiredis-devel \ less \ libstdc++-static \ diff --git a/misc/build-in-docker b/misc/build-in-docker index f6811c76..34aba840 100755 --- a/misc/build-in-docker +++ b/misc/build-in-docker @@ -23,6 +23,7 @@ shift top_dir="$(dirname "$(realpath "$0")")/.." tag="ccache-build:$name" +launcher="${LAUNCHER:-}" command="${COMMAND:-/source/ci/build}" interactive="${INTERACTIVE:+--interactive --tty}" nocache="${NOCACHE:+--no-cache}" @@ -57,4 +58,4 @@ docker run \ --env VERBOSE="${VERBOSE:-}" \ $interactive \ "$tag" \ - "$command" "$@" + sh -c "$launcher $command" "$@" diff --git a/misc/test-some-systems b/misc/test-some-systems index 48237483..cade6ac3 100755 --- a/misc/test-some-systems +++ b/misc/test-some-systems @@ -13,8 +13,8 @@ build() { local cc=$2 local cxx=$3 local test_cc=$4 - shift 4 - local cmake_params="$*" + local cmake_params=${5:-} + local launcher=${6:-} echo "======================================================================" echo "=== ${name} ${cc} ${cxx} ${test_cc} ${cmake_params}" @@ -25,42 +25,43 @@ build() { fi if command -v >/dev/null ccache; then - cmake_params="${cmake_params} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" + cmake_params="${cmake_params} -DCMAKE_C_COMPILER_LAUNCHERER=ccache -DCMAKE_CXX_COMPILER_LAUNCHERER=ccache" fi echo "Build in Docker: $name CC=$cc CXX=$cxx TEST_CC=$test_cc CMAKE_PARAMS=\"$*\"" - ASM=$cc CC=$cc CXX=$cxx TEST_CC=$test_cc CMAKE_PARAMS="${cmake_params}" $build_in_docker $name + ASM=$cc CC=$cc CXX=$cxx TEST_CC=$test_cc CMAKE_PARAMS="${cmake_params}" LAUNCHER="${launcher}"\ + bash -x $build_in_docker $name } # NAME CC CXX TEST_CC CMAKE_PARAMS -build alma-8 gcc g++ gcc -D DEPS=DOWNLOAD -build alma-8 clang clang++ clang -D DEPS=DOWNLOAD +build alma-8 gcc g++ gcc "-D DEPS=DOWNLOAD" "scl enable gcc-toolset-11" +build alma-8 clang clang++ clang "-D DEPS=DOWNLOAD" "scl enable gcc-toolset-11" -build alma-9 gcc g++ gcc -D DEPS=DOWNLOAD -build alma-9 clang clang++ clang -D DEPS=DOWNLOAD +build alma-9 gcc g++ gcc "-D DEPS=DOWNLOAD" +build alma-9 clang clang++ clang "-D DEPS=DOWNLOAD" -build alma-10 gcc g++ gcc -D DEPS=DOWNLOAD -build alma-10 clang clang++ clang -D DEPS=DOWNLOAD +build alma-10 gcc g++ gcc "-D DEPS=DOWNLOAD" +build alma-10 clang clang++ clang "-D DEPS=DOWNLOAD" build alpine-3.23 gcc g++ gcc -build alpine-3.23 clang clang++ clang -D DEPS=DOWNLOAD +build alpine-3.23 clang clang++ clang "-D DEPS=DOWNLOAD -D ENABLE_TESTING=OFF" # doctest issue #900 -build debian-11 gcc g++ gcc -D DEPS=DOWNLOAD -build debian-11 clang clang++ clang -D DEPS=DOWNLOAD +build debian-11 gcc g++ gcc "-D DEPS=DOWNLOAD" +build debian-11 clang clang++ clang "-D DEPS=DOWNLOAD" -build debian-12 gcc g++ gcc -D DEPS=DOWNLOAD -build debian-12 clang clang++ clang -D DEPS=DOWNLOAD +build debian-12 gcc g++ gcc "-D DEPS=DOWNLOAD" +build debian-12 clang clang++ clang "-D DEPS=DOWNLOAD" -build debian-13 gcc g++ gcc -D DEPS=DOWNLOAD -build debian-13 clang clang++ clang -D DEPS=DOWNLOAD +build debian-13 gcc g++ gcc "-D DEPS=DOWNLOAD" +build debian-13 clang clang++ clang "-D DEPS=DOWNLOAD" -build fedora-42 gcc g++ gcc -D DEPS=DOWNLOAD -build fedora-42 clang clang++ clang -D DEPS=DOWNLOAD -D ENABLE_TESTING=OFF # doctest issue #900 +build fedora-42 gcc g++ gcc "-D DEPS=DOWNLOAD" +build fedora-42 clang clang++ clang "-D DEPS=DOWNLOAD -D ENABLE_TESTING=OFF" # doctest issue #900 -build ubuntu-22.04 gcc-11 g++-11 gcc -D DEPS=DOWNLOAD -build ubuntu-22.04 gcc-12 g++-12 gcc -D DEPS=DOWNLOAD -build ubuntu-22.04 clang clang++ clang -D DEPS=DOWNLOAD +build ubuntu-22.04 gcc-11 g++-11 gcc "-D DEPS=DOWNLOAD" +build ubuntu-22.04 gcc-12 g++-12 gcc "-D DEPS=DOWNLOAD" +build ubuntu-22.04 clang clang++ clang "-D DEPS=DOWNLOAD" -build ubuntu-24.04 gcc-13 g++-13 gcc -D DEPS=DOWNLOAD -build ubuntu-24.04 gcc-14 g++-14 gcc -D DEPS=DOWNLOAD -build ubuntu-24.04 clang clang++ clang -D DEPS=DOWNLOAD +build ubuntu-24.04 gcc-13 g++-13 gcc "-D DEPS=DOWNLOAD" +build ubuntu-24.04 gcc-14 g++-14 gcc "-D DEPS=DOWNLOAD" +build ubuntu-24.04 clang clang++ clang "-D DEPS=DOWNLOAD"