From: Kefu Chai Date: Wed, 12 Feb 2020 08:05:14 +0000 (+0800) Subject: cmake: disable concepts in boost::asio X-Git-Tag: v15.1.1~456^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b556e42e20b13f76a6878b5bd2ade19b886d16e9;p=ceph.git cmake: disable concepts in boost::asio 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 --- diff --git a/src/crimson/CMakeLists.txt b/src/crimson/CMakeLists.txt index 3d2ffc066efb..9ead32b9c748 100644 --- a/src/crimson/CMakeLists.txt +++ b/src/crimson/CMakeLists.txt @@ -1,6 +1,13 @@ 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