]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Toolset: Use libc++ as libstdc++ is broken on old compilers
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 9 Feb 2021 16:26:54 +0000 (16:26 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 9 Feb 2021 16:26:54 +0000 (16:26 +0000)
cmake/Toolset.cmake
src/libserver/css/css_tokeniser.hxx

index d54abb795bd56ed838a540b77d78962cc25fa38b..5a4faebf2a161a3e2b7c5357fa2617e1a8aab117 100644 (file)
@@ -27,17 +27,19 @@ endif ()
 
 if (COMPILER_GCC)
     # Require minimum version of gcc
-    set (GCC_MINIMUM_VERSION 4)
+    set (GCC_MINIMUM_VERSION 8)
     if (CMAKE_C_COMPILER_VERSION VERSION_LESS ${GCC_MINIMUM_VERSION} AND NOT CMAKE_VERSION VERSION_LESS 2.8.9)
         message (FATAL_ERROR "GCC version must be at least ${GCC_MINIMUM_VERSION}.")
     endif ()
 elseif (COMPILER_CLANG)
     # Require minimum version of clang
-    set (CLANG_MINIMUM_VERSION 4)
+    set (CLANG_MINIMUM_VERSION 7)
     if (CMAKE_C_COMPILER_VERSION VERSION_LESS ${CLANG_MINIMUM_VERSION})
         message (FATAL_ERROR "Clang version must be at least ${CLANG_MINIMUM_VERSION}.")
     endif ()
     ADD_COMPILE_OPTIONS(-Wno-unused-command-line-argument)
+    # Use libc++ as libstdc++ is buggy in many cases
+    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
 else ()
     message (WARNING "You are using an unsupported compiler ${CMAKE_C_COMPILER_ID}. Compilation has only been tested with Clang 4+ and GCC 4+.")
 endif ()
index afe888a80ff0b457fae1f1aeb957686b617244fd..f1e9d05fc188b8a52a413e365ffd74d04d65b920 100644 (file)
@@ -102,6 +102,10 @@ struct css_parser_token {
 };
 
 /* Ensure that parser tokens are simple enough */
+/*
+ * compiler must implement P0602 "variant and optional should propagate copy/move triviality"
+ * This is broken on gcc < 8!
+ */
 static_assert(std::is_trivially_copyable_v<css_parser_token>);
 
 class css_tokeniser {