# 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
# 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
#
endforeach()
include(StdAtomic)
- include(StdFilesystem)
elseif(MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(standard_settings INTERFACE
/Zc:__cplusplus
+++ /dev/null
-# Check if std::filesystem needs -lstdc++fs
-
-include(CheckCXXSourceCompiles)
-
-set(
- check_std_filesystem_source_code
- [=[
- #include <filesystem>
- 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()