@@ -89,21 +89,29 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
8989
9090 # Additional GCC-specific compiler settings.
9191 if ("${CMAKE_CXX_COMPILER_ID} " MATCHES "GNU" )
92- # Check that we've got GCC 8.0 or newer.
93- if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0))
94- message (FATAL_ERROR "${PROJECT_NAME} requires g++ 8.0 or greater." )
92+ # Check that we've got GCC 11.0 or newer.
93+ if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0))
94+ message (FATAL_ERROR "${PROJECT_NAME} requires g++ 11.0 or greater." )
95+ endif ()
96+
97+ # GCC 12 emits warnings for string concatenations with operator+ under O3
98+ # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651
99+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
100+ add_compile_options (-Wno-error=restrict)
95101 endif ()
96102
97103 # Use fancy colors in the compiler diagnostics
98104 add_compile_options (-fdiagnostics-color)
99105
100106 # Additional Clang-specific compiler settings.
101107 elseif ("${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" )
102- # Check that we've got clang 7 .0 or newer.
103- if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7 .0))
104- message (FATAL_ERROR "${PROJECT_NAME} requires clang++ 7 .0 or greater." )
108+ # Check that we've got clang 14 .0 or newer.
109+ if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14 .0))
110+ message (FATAL_ERROR "${PROJECT_NAME} requires clang++ 14 .0 or greater." )
105111 endif ()
106112
113+ # use std::invoke_result, superseding std::result_of which has been removed in c++20
114+ add_compile_definitions (BOOST_ASIO_HAS_STD_INVOKE_RESULT)
107115 if ("${CMAKE_SYSTEM_NAME} " MATCHES "Darwin" )
108116 # Set stack size to 32MB - by default Apple's clang defines a stack size of 8MB.
109117 # Normally 16MB is enough to run all tests, but it will exceed the stack, if -DSANITIZE=address is used.
0 commit comments