]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: disable concepts in boost::asio
authorKefu Chai <kchai@redhat.com>
Wed, 12 Feb 2020 08:05:14 +0000 (16:05 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 12 Feb 2020 08:33:20 +0000 (16:33 +0800)
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>
src/crimson/CMakeLists.txt

index 3d2ffc066efb609e4b14aa4652f125b38f82352b..9ead32b9c74837fafb745f1d7ba5a6442e206815 100644 (file)
@@ -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