Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[INFRA] CMake
  • Loading branch information
eseiler committed Sep 29, 2023
commit ea9956bfb26e9f25c8778558105e334dbf570baa
12 changes: 2 additions & 10 deletions build_system/seqan3-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

# ----------------------------------------------------------------------------
Expand Down
12 changes: 10 additions & 2 deletions include/seqan3/core/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,21 @@
# endif // (__GNUC__ > 13)
# endif // SEQAN3_DISABLE_NEWER_COMPILER_DIAGNOSTIC

// ============================================================================
// Compiler support Clang
// ============================================================================

#elif defined(__clang__)
# 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

// ============================================================================
Expand Down