Skip to content

Commit

Permalink
[INFRA] CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Sep 28, 2023
1 parent 5c0e35a commit 960d0fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
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(__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

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

0 comments on commit 960d0fa

Please sign in to comment.