cmake: define BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT for
authorKefu Chai <kchai@redhat.com>
Thu, 28 Jan 2021 15:45:23 +0000 (15:45 +0000)
committerThomas Goirand <zigo@debian.org>
Thu, 28 Jan 2021 15:45:23 +0000 (15:45 +0000)
Signed-off-by: Kefu Chai <kchai@redhat.com>
Origin: upstream, https://github.com/ceph/ceph/commit/3d708219092d0e89a1434c30ffc8a4999f062cc0.patch
Bug-Debian: https://bugs.debian.org/977243
Last-Update: 2020-12-13

Boost.Asio users

see also
https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio/std_executors.html#boost_asio.std_executors.polymorphic_i_o_executor

we could use `asio::any_io_executor` later on though for better
performance.

also, define CMP0093, so FindBoost reports Boost_VERSION in x.y.z
format. it is simpler to use `VERSION_GREATER_EQUAL` to compare its
version with 1.74 instead of its C macro version ("107000").

Gbp-Pq: Name cmake_define_BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT_for_Boost.Asio_users.patch

CMakeLists.txt
src/librbd/CMakeLists.txt

index 0ac4d24aa8dde569d21831abf19fcc9b300c05ee..be0bb92676836536451fbf13c6b0fb43b65e6d05 100644 (file)
@@ -21,6 +21,9 @@ endif()
 if(POLICY CMP0051)
   cmake_policy(SET CMP0051 NEW)
 endif()
+if(POLICY CMP0074)
+  cmake_policy(SET CMP0074 NEW)
+endif()
 if(POLICY CMP0075)
   cmake_policy(SET CMP0075 NEW)
 endif()
index 30626d02bdf667c7854ac067e6c606f298ed1d82..b8c4b04574f45e79d81d9739d72a327d8bc5ce40 100644 (file)
@@ -1,3 +1,7 @@
+if(Boost_VERSION VERSION_GREATER_EQUAL 1.74)
+  add_definitions(-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+endif()
+
 add_library(rbd_types STATIC
   journal/Types.cc
   mirroring_watcher/Types.cc