Skip to content

Commit 4afd120

Browse files
committed
[MISC] Simplify compiler check in platform.hpp
1 parent 7442cf4 commit 4afd120

File tree

1 file changed

+18
-37
lines changed

1 file changed

+18
-37
lines changed

include/seqan3/core/platform.hpp

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*
4141
* \sa https://sourceforge.net/p/predef/wiki/Compilers
4242
*/
43-
#if defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER)
43+
#if defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER)
4444
# define SEQAN3_COMPILER_IS_GCC 1
4545
#else
4646
# define SEQAN3_COMPILER_IS_GCC 0
@@ -52,51 +52,32 @@
5252
#endif // SEQAN3_DOXYGEN_ONLY(1)0
5353

5454
// ============================================================================
55-
// Compiler support GCC
55+
// Compiler support
5656
// ============================================================================
5757

58-
#if SEQAN3_COMPILER_IS_GCC
59-
# if (__GNUC__ < 11)
60-
# error \
61-
"SeqAn 3.1.x is the last version that supports GCC 7, 8, and 9. SeqAn 3.2.x is the latest version that support GCC 10. Please upgrade your compiler or use 3.1.x./3.2.x."
62-
# endif // (__GNUC__ < 11)
63-
64-
# if (__GNUC__ == 11 && __GNUC_MINOR__ <= 3)
65-
# pragma GCC warning "Be aware that GCC < 11.4 might have bugs that cause SeqAn3 fail to compile."
66-
# endif // (__GNUC__ == 11 && __GNUC_MINOR__ <= 2)
67-
68-
# if (__GNUC__ == 12 && __GNUC_MINOR__ <= 2)
69-
# pragma GCC warning "Be aware that GCC < 12.3 might have bugs that cause SeqAn3 fail to compile."
70-
# endif // (__GNUC__ == 12 && __GNUC_MINOR__ <= 1)
58+
#if SEQAN3_COMPILER_IS_GCC && (__GNUC__ < 12)
59+
# error "At least GCC 12 is needed."
60+
#endif
7161

72-
# if SEQAN3_DOXYGEN_ONLY(1) 0
73-
//!\brief This disables the warning you would get if your compiler is newer than the latest supported version.
74-
# define SEQAN3_DISABLE_NEWER_COMPILER_DIAGNOSTIC
75-
# endif // SEQAN3_DOXYGEN_ONLY(1)0
62+
#if defined(__INTEL_LLVM_COMPILER) && (__INTEL_LLVM_COMPILER < 20240000)
63+
# error "At least Intel OneAPI 2024 is needed."
64+
#endif
7665

77-
# ifndef SEQAN3_DISABLE_NEWER_COMPILER_DIAGNOSTIC
78-
# if (__GNUC__ > 14)
79-
# pragma message \
80-
"Your compiler is newer than the latest supported compiler of this SeqAn version (gcc-13). It might be that SeqAn does not compile due to this. You can disable this warning by setting -DSEQAN3_DISABLE_NEWER_COMPILER_DIAGNOSTIC."
81-
# endif // (__GNUC__ > 13)
82-
# endif // SEQAN3_DISABLE_NEWER_COMPILER_DIAGNOSTIC
66+
#if defined(__clang__) && defined(__clang_major__) && (__clang_major__ < 17)
67+
# error "At least Clang 17 is needed."
68+
#endif
8369

8470
// ============================================================================
85-
// Compiler support Clang
71+
// Standard library support
8672
// ============================================================================
8773

88-
#elif defined(__clang__)
89-
# if __clang_major__ < 17
90-
# error "Only Clang >= 17 is supported."
91-
# endif
92-
93-
// ============================================================================
94-
// Compiler support other
95-
// ============================================================================
74+
#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION < 170000)
75+
# error "At least libc++ 17 is required."
76+
#endif
9677

97-
#elif !defined(SEQAN3_DISABLE_COMPILER_CHECK)
98-
# error "Your compiler is not supported. You can disable this error by setting -DSEQAN3_DISABLE_COMPILER_CHECK."
99-
#endif // SEQAN3_COMPILER_IS_GCC
78+
#if defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 12)
79+
# error "At least libstdc++ 12 is needed."
80+
#endif
10081

10182
// ============================================================================
10283
// C++ standard and features

0 commit comments

Comments
 (0)