From 960d0fab69131782774f015da9febbc4492c3b34 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Thu, 28 Sep 2023 18:57:30 +0200 Subject: [PATCH] [INFRA] CMake --- build_system/seqan3-config.cmake | 12 ++---------- include/seqan3/core/platform.hpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build_system/seqan3-config.cmake b/build_system/seqan3-config.cmake index 8849ea386b..37f24a6c0d 100644 --- a/build_system/seqan3-config.cmake +++ b/build_system/seqan3-config.cmake @@ -196,16 +196,8 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VER message (FATAL_ERROR "GCC < 10 is not supported. The detected compiler version is ${CMAKE_CXX_COMPILER_VERSION}.") endif () -option (SEQAN3_DISABLE_COMPILER_CHECK "Skips the check for supported compilers." OFF) - -if (NOT SEQAN3_DISABLE_COMPILER_CHECK) - if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - message (FATAL_ERROR "Only GCC is supported. " - "The detected compiler version is ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}. " - "You can disable this error by passing -DSEQAN3_DISABLE_COMPILER_CHECK=ON to CMake.") - endif () -else () - set (SEQAN3_DEFINITIONS ${SEQAN3_DEFINITIONS} "-DSEQAN3_DISABLE_COMPILER_CHECK") +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17) + message (FATAL_ERROR "Clang < 17 is not supported. The detected compiler version is ${CMAKE_CXX_COMPILER_VERSION}.") endif () # ---------------------------------------------------------------------------- diff --git a/include/seqan3/core/platform.hpp b/include/seqan3/core/platform.hpp index 1fd92faa79..bc02a54b1f 100644 --- a/include/seqan3/core/platform.hpp +++ b/include/seqan3/core/platform.hpp @@ -86,13 +86,21 @@ # endif // (__GNUC__ > 13) # endif // SEQAN3_DISABLE_NEWER_COMPILER_DIAGNOSTIC +// ============================================================================ +// Compiler support Clang +// ============================================================================ + +#elif defined(__llvm__) +# if __clang_major__ < 17 +# error "Only Clang >= 17 is supported." +# endif + // ============================================================================ // Compiler support other // ============================================================================ #elif !defined(SEQAN3_DISABLE_COMPILER_CHECK) -# error \ - "Your compiler is not supported. Currently, only GCC is known to work. You can disable this error by setting -DSEQAN3_DISABLE_COMPILER_CHECK." +# error "Your compiler is not supported. You can disable this error by setting -DSEQAN3_DISABLE_COMPILER_CHECK." #endif // SEQAN3_COMPILER_IS_GCC // ============================================================================