GCC-10 and Clang choke when compiling a concept constrained with
its template parameter, which is in turn another concept. as a
workaround of the bug of boost::asio, we should disable concepts
support in it. but it's nice to enable it when the compiler is
able to use concepts to do some compile time checkings even the
concepts are not compliant to C++20.
Signed-off-by: Kefu Chai <kchai@redhat.com>
add_library(crimson::cflags INTERFACE IMPORTED)
+set(crimson_cflag_definitions "WITH_SEASTAR=1")
+# disable concepts to address https://github.com/boostorg/asio/issues/312
+if((CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10) OR
+ (CMAKE_CXX_COMPILER_ID STREQUAL Clang))
+ list(APPEND crimson_cflag_definitions
+ "BOOST_ASIO_DISABLE_CONCEPTS")
+endif()
set_target_properties(crimson::cflags PROPERTIES
- INTERFACE_COMPILE_DEFINITIONS "WITH_SEASTAR=1"
+ INTERFACE_COMPILE_DEFINITIONS "${crimson_cflag_definitions}"
INTERFACE_LINK_LIBRARIES Seastar::seastar)
set(crimson_common_srcs