]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: define BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT for Boost.Asio users
authorKefu Chai <kchai@redhat.com>
Tue, 24 Nov 2020 06:12:54 +0000 (14:12 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 24 Nov 2020 07:50:19 +0000 (15:50 +0800)
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").

Signed-off-by: Kefu Chai <kchai@redhat.com>
CMakeLists.txt
src/librbd/CMakeLists.txt

index a5c560fee6d9d865af0de9f0881fb7dedfe9adfe..f71284ae1e37936223b56a838706cba75afd766d 100644 (file)
@@ -14,7 +14,8 @@ foreach(policy
     CMP0056
     CMP0065
     CMP0074
-    CMP0075)
+    CMP0075
+    CMP0093)
   if(POLICY ${policy})
     cmake_policy(SET ${policy} NEW)
   endif()
index 6f7977fdae5b9a161b0be5494fdf31f54c47fbff..4c32797801f849b39f485b34ec6bfe2f65c0f809 100644 (file)
@@ -1,3 +1,7 @@
+if(Boost_VERSION VERSION_GREATER_EQUAL 1.74)
+  add_definitions(-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+endif()
+
 set(librbd_types_srcs
   journal/Types.cc
   mirroring_watcher/Types.cc