From: Joel Rosdahl Date: Tue, 3 Feb 2026 19:26:45 +0000 (+0100) Subject: chore: Bump required compiler versions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fac62b7ac5faaff9b137a8f0ff47045dfc3a36c3;p=thirdparty%2Fccache.git chore: Bump required compiler versions --- diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0662ccbb..4be4b2df 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -102,13 +102,6 @@ jobs: # The -multilib packages are only available on x86. sudo apt-get install -y g++-${{ matrix.version }}-multilib fi - if [ "${{ matrix.version }}" = 8 ]; then - # The compilation test in StdFilesystem.cmake doesn't work when - # GCC 9 is installed as well, so need to force linking with - # libstdc++fs for GCC 8. Note: This requires using -fuse-ld=lld to - # work. - echo "LDFLAGS=-lstdc++fs" >> $GITHUB_ENV - fi else echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f934fc0..470d4eb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,27 +26,15 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # C++ error messages) # -if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.8) - OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5) - OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)) +if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7) + OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10) + OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10)) message( FATAL_ERROR "The compiler you are using is too old, sorry.\n" "You need one listed here: https://ccache.dev/platform-compiler-language-support.html") endif() -if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4) - OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6)) - message( - WARNING - "The compiler you are using is rather old.\n" - "If anything goes wrong you might be better off with one listed here:" - " https://ccache.dev/platform-compiler-language-support.html") - - # Warnings from old compilers are probably useless anyway. - option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" FALSE) -endif() - # # Settings # diff --git a/cmake/StandardSettings.cmake b/cmake/StandardSettings.cmake index f82e2320..430c237d 100644 --- a/cmake/StandardSettings.cmake +++ b/cmake/StandardSettings.cmake @@ -58,7 +58,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "^GNU|(Apple)?Clang$" AND NOT MSVC) endforeach() include(StdAtomic) - include(StdFilesystem) elseif(MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(standard_settings INTERFACE /Zc:__cplusplus diff --git a/cmake/StdFilesystem.cmake b/cmake/StdFilesystem.cmake deleted file mode 100644 index ca451ce7..00000000 --- a/cmake/StdFilesystem.cmake +++ /dev/null @@ -1,26 +0,0 @@ -# Check if std::filesystem needs -lstdc++fs - -include(CheckCXXSourceCompiles) - -set( - check_std_filesystem_source_code - [=[ - #include - int main(void) - { - return std::filesystem::is_regular_file(\"/\") ? 0 : 1; - } - ]=]) - -check_cxx_source_compiles("${check_std_filesystem_source_code}" std_filesystem_without_libfs) - -if(NOT std_filesystem_without_libfs) - set(CMAKE_REQUIRED_LIBRARIES stdc++fs) - check_cxx_source_compiles("${check_std_filesystem_source_code}" std_filesystem_with_libfs) - set(CMAKE_REQUIRED_LIBRARIES) - if(NOT std_filesystem_with_libfs) - message(FATAL_ERROR "Toolchain doesn't support std::filesystem with nor without -lstdc++fs") - else() - target_link_libraries(standard_settings INTERFACE stdc++fs) - endif() -endif()